From 96d21e578174f11e42df5e46557f04c6353b40da Mon Sep 17 00:00:00 2001 From: Granty1 Date: Thu, 9 Apr 2020 17:34:17 +0800 Subject: [PATCH] Format config file and ci script --- .github/workflows/go.yml | 20 +++++++++++++------- server/config.yaml | 10 +++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4dca4916..c15cb60f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,4 +1,4 @@ -name: gin-vue-admin ci&cd +name: gin-vue-admin-backend ci&cd on: push: @@ -8,14 +8,16 @@ jobs: build: name: Build - runs-on: [ self-hosted ] + runs-on: [ self-hosted, backend_runner ] steps: - name: Check out the repository - uses: actions/checkout@v2 + uses: actions/checkout@master - name: Show files - run: ls -la + run: | + pwd + ls -la - name: Get dependencies run: | @@ -30,12 +32,16 @@ jobs: run: | go build -v . working-directory: ./server + - name: Modify config params run: | - sed -i 's/%{address}/'$MYSQL_ADDR'/' config.yaml - sed -i 's/%{username}/'$MYSQL_USERNAME'/' config.yaml - sed -i 's/%{password}/'$MSQL_PASSWORD'/' config.yaml + sed -i 's/%{mysql_address}/'$MYSQL_ADDR'/' config.yaml + sed -i 's/%{mysql_username}/'$MYSQL_USERNAME'/' config.yaml + sed -i 's/%{mysql_password}/'$MSQL_PASSWORD'/' config.yaml + sed -i 's/%{redis_address}/'$REDIS_ADDR'/' config.yaml + sed -i 's/%{redis_password}/'$REDIS_PASSWORD'/' config.yaml working-directory: ./server + - name: Run run: | nohup ./gin-vue-admin & diff --git a/server/config.yaml b/server/config.yaml index 3bf203b7..1e23e2da 100644 --- a/server/config.yaml +++ b/server/config.yaml @@ -10,9 +10,9 @@ jwt: # mysql connect configuration mysql: - username: %{username} - password: %{password} - path: %{address} + username: %{mysql_username} + password: %{mysql_password} + path: %{mysql_address} db-name: 'qmPlus' config: 'charset=utf8&parseTime=True&loc=Local' max-idle-conns: 10 @@ -26,8 +26,8 @@ qiniu: # redis configuration redis: - addr: '127.0.0.1:6379' - passwprd: '' + addr: %{redis_address} + passwprd: %{redis_password} db: 0 # system configuration