goblog

command module
v0.0.0-...-24649a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 17 Imported by: 0

README

go-test Deployment

Example

http://1.117.145.187/blog

Goblog deploy steps:

1. upload the docker-compose-no-build.yml file to server

scp docker-compose-no-build.yml root@x.x.x.x:/root

2. create mysql data dir

mkdir -p /var/lib/mysql

3. create redis data dir

mkdir -p /var/lib/data

mkdir -p /var/lib/rocketmq/data/namesrv/logs
mkdir -p /var/lib/rocketmq/data/namesrv/store
mkdir -p /var/lib/rocketmq/data/broker/logs
mkdir -p /var/lib/rocketmq/rocketmq/data/broker/store
mkdir -p /var/lib/rocketmq/conf
5. create broker.conf file

mkdir -p /var/lib/rocketmq/conf/broker.conf

with content

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
namesrvAddr = namesrv:9876
#brokerIP1 = 172.17.0.4
brokerIP1=broker-a
6. install docker and docker-compose
yum install docker -y
yum install docker-compose -y
7. start docker

systemctl start docker

8. run goblog

docker-compose -f docker-compose-no-build.yml up -d

Update image

1. build image

docker build -t beslow/goblog .

2. push to docker.io, need docker login

docker push beslow/goblog

3. update image locally

docker pull beslow/goblog:latest

Test

1. create test database

CONFIG_DIR=test go run main.go -db:create

2. migrate test database

CONFIG_DIR=test go run main.go -db:migrate

3. seed test database

CONFIG_DIR=test go run main.go -db:seed

4. generate assets

go generate test/*.go

5. run test

go test ./...

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db
ga
rocketmq
This file is generated by GoAdmin CLI adm.
This file is generated by GoAdmin CLI adm.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL