upload s3 bucket

This commit is contained in:
heyethereum
2024-06-18 00:25:43 +08:00
parent 4f3bd47118
commit 9ff0e30334

View File

@@ -61,5 +61,7 @@ jobs:
- name: Download and Verify JAR on EC2 - name: Download and Verify JAR on EC2
run: | run: |
aws ssm send-command --instance-ids ${{ env.INSTANCE_ID }} --document-name "AWS-RunShellScript" --comment "Download JAR file" --parameters 'commands=["curl -o /home/app-0.0.1-SNAPSHOT.jar ${{ env.PRESIGNED_URL }}", "ls -l /home/app-0.0.1-SNAPSHOT.jar"]' aws ssm send-command --instance-ids ${{ env.INSTANCE_ID }} --document-name "AWS-RunShellScript" --comment "Download JAR file" --parameters 'commands=["curl -o /home/app-0.0.1-SNAPSHOT.jar ${{ env.PRESIGNED_URL }}", "ls -l /home/app-0.0.1-SNAPSHOT.jar"]'
- 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=["echo \\"[Unit]\nDescription=Spring Boot Application\nAfter=network.target\n\n[Service]\nUser=ec2-user\nExecStart=/usr/bin/java -jar /home/app-0.0.1-SNAPSHOT.jar\nRestart=always\n\n[Install]\nWantedBy=multi-user.target\\" > /etc/systemd/system/springboot-app.service", "sudo systemctl daemon-reload", "sudo systemctl enable springboot-app", "sudo systemctl start springboot-app", "sudo systemctl status springboot-app"]'