From 64804f0413e98283d1a95e449e208ed89ba2f95e Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 31 Aug 2023 14:45:46 +0800 Subject: [PATCH] [Temporary commit] deploy to production --- .github/workflows/ci-cd.yml | 17 +++++++++-------- hashicorp/scripts/setup.sh | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index ae64c591..5141084f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -132,28 +132,29 @@ jobs: with: java-version: ${{ env.JDK_VERSION }} distribution: ${{ env.JDK_DISTRIBUTION }} - - uses: ./.github/actions/create-mvn-settings + - name: Generate settings.xml + uses: ./.github/actions/create-mvn-settings with: nexus-server-id: ${{ secrets.NEXUS_SERVER_ID }} nexus-user: ${{ secrets.NEXUS_USER }} nexus-token: ${{ secrets.NEXUS_TOKEN }} - - name: Load compile-time settings + - name: Load webservice settings run: | echo "${{ secrets.APPLICATION_PROPERTIES }}" > src/main/resources/application.properties echo "${{ secrets.JPADATASTORE_PROPERTIES }}" > src/main/resources/jpadatastore.properties - name: Generate webservice WAR file - run: mvn -B clean package -Dmaven.test.skip + run: mvn -B clean package + - name: Load SSL Certificates into AMI + working-directory: hashicorp/images + run: | + echo '${{ secrets.SSL_CERTIFICATE }}' > server.crt + echo '${{ secrets.SSL_CERTIFICATE_KEY }}' > server.key - name: Load runtime settings into Terraform variable file working-directory: hashicorp/instances run: | touch variables.auto.tfvars echo 'zone_id = "${{ secrets.ZONE_ID }}"' > variables.auto.tfvars echo 'sentry_dsn = "${{ secrets.SENTRY_DSN }}"' >> variables.auto.tfvars - - name: Load SSL Certificates - working-directory: hashicorp/images - run: | - echo '${{ secrets.SSL_CERTIFICATE }}' > server.crt - echo '${{ secrets.SSL_CERTIFICATE_KEY }}' > server.key - name: Push AMI and Deploy EC2 uses: QubitPi/aergia@master with: diff --git a/hashicorp/scripts/setup.sh b/hashicorp/scripts/setup.sh index 197d0c47..1acc2526 100644 --- a/hashicorp/scripts/setup.sh +++ b/hashicorp/scripts/setup.sh @@ -46,6 +46,6 @@ rm jetty-home-$JETTY_VERSION.tar.gz export JETTY_HOME=/home/ubuntu/jetty-home-$JETTY_VERSION mkdir jetty-base cd jetty-base -java -jar $JETTY_HOME/start.jar --add-module=annotations,server,http,deploy +java -jar $JETTY_HOME/start.jar --add-module=annotations,server,http,deploy,servlet,webapp,resources,jsp,websocket mv /home/ubuntu/ROOT.war webapps/ROOT.war cd ../