Przeglądaj źródła

add dotenv for automatic installation

Yuki Takei 4 lat temu
rodzic
commit
0069fc5cf5

+ 7 - 1
.github/workflows/reusable-app-prod.yml

@@ -233,6 +233,12 @@ jobs:
         SPEC=`node bin/github-actions/generate-cypress-spec-arg.js --prefix="test/cypress/integration/" --suffix="-*/**" "${{ matrix.spec-group }}"`
         SPEC=`node bin/github-actions/generate-cypress-spec-arg.js --prefix="test/cypress/integration/" --suffix="-*/**" "${{ matrix.spec-group }}"`
         echo "::set-output name=value::$SPEC"
         echo "::set-output name=value::$SPEC"
 
 
+    - name: Copy dotenv file for automatic installation
+      if: ${{ matrix.spec-group != '1' }}
+      working-directory: ./packages/app
+      run: |
+        cat config/ci/.env.local.for-auto-install >> .env.production.local
+
     - name: Cypress Run
     - name: Cypress Run
       uses: cypress-io/github-action@v2
       uses: cypress-io/github-action@v2
       with:
       with:
@@ -240,7 +246,7 @@ jobs:
         install: false
         install: false
         spec: '${{ steps.determine-spec-exp.outputs.value }}'
         spec: '${{ steps.determine-spec-exp.outputs.value }}'
         build: |
         build: |
-          cp config/ci/.env.local.for-ci .env.production.local
+          cat config/ci/.env.local.for-ci >> .env.production.local
         start: yarn server
         start: yarn server
         wait-on: 'http://localhost:3000'
         wait-on: 'http://localhost:3000'
       env:
       env:

+ 7 - 0
packages/app/config/ci/.env.local.for-auto-install

@@ -0,0 +1,7 @@
+APP_SITE_URL=http://localhost:3000
+
+AUTO_INSTALL_ADMIN_USERNAME=admin
+AUTO_INSTALL_ADMIN_NAME=Admin
+AUTO_INSTALL_ADMIN_EMAIL=admin@example.com
+AUTO_INSTALL_ADMIN_PASSWORD=adminadmin
+AUTO_INSTALL_GLOBAL_LANG=zh_CN