From 1fa79bbd3cc9dd0b28c1db0b6ea7a33a50ae326f Mon Sep 17 00:00:00 2001 From: heyethereum Date: Tue, 18 Jun 2024 23:43:50 +0800 Subject: [PATCH] update env variable --- .github/workflows/workflow.yml | 13 ++++++++----- src/main/resources/application.properties | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 28484f8..eae040a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -68,9 +68,12 @@ jobs: - name: Create and Start Systemd Service run: | aws ssm send-command --instance-ids ${{ env.INSTANCE_ID }} --document-name "AWS-RunShellScript" --comment "Create and start service" --parameters 'commands=[ - "sudo bash -c '\''cat < /etc/systemd/system/springboot-app.service\n[Unit]\nDescription=Spring Boot Application\nAfter=network.target\n\n[Service]\nUser=ssm-user\nExecStart=/usr/bin/java -jar /home/ssm-user/app-0.0.1-SNAPSHOT.jar\nSuccessExitStatus=143\nRestart=always\nRestartSec=3\n\n[Install]\nWantedBy=multi-user.target\nEOF'\''", - "sudo systemctl daemon-reload", - "sudo systemctl enable springboot-app", - "sudo systemctl start springboot-app", - "sudo systemctl status springboot-app" + "aws s3 cp s3://s3-bucket-safeqr/update_env_var.sh /home/ssm-user/update_env_var.sh", + "chmod +x /home/ssm-user/update_env_var.sh", + "source /home/ssm-user/.bashrc", + "sudo bash -c '\''cat < /etc/systemd/system/springboot-app.service\n[Unit]\nDescription=Spring Boot Application\nAfter=network.target\n\n[Service]\nUser=ssm-user\nExecStart=/usr/bin/java -jar /home/ssm-user/app-0.0.1-SNAPSHOT.jar\nSuccessExitStatus=143\nRestart=always\nRestartSec=3\n\n[Install]\nWantedBy=multi-user.target\nEOF'\''", + "sudo systemctl daemon-reload", + "sudo systemctl enable springboot-app", + "sudo systemctl start springboot-app", + "sudo systemctl status springboot-app" ]' diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 2f7ba85..80137c6 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.application.name=SafeQR-app #spring.profiles.active=local http.port=${HTTP_PORT} -server.port=8081 +server.port=${SERVER_PORT} server.ssl.enabled=true server.ssl.key-store-type=${SERVER_SSL_KEY_STORE_TYPE} server.ssl.key-store=${SERVER_SSL_KEY_STORE_LOCATION}