upload s3 bucket
This commit is contained in:
5
.github/workflows/workflow.yml
vendored
5
.github/workflows/workflow.yml
vendored
@@ -22,7 +22,6 @@ jobs:
|
|||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
cache: maven
|
cache: maven
|
||||||
|
|
||||||
|
|
||||||
- name: Create application-local.properties file
|
- name: Create application-local.properties file
|
||||||
run: |
|
run: |
|
||||||
echo "spring.datasource.url=${{ secrets.DB_URL }}" >> src/main/resources/application-local.properties
|
echo "spring.datasource.url=${{ secrets.DB_URL }}" >> src/main/resources/application-local.properties
|
||||||
@@ -60,8 +59,8 @@ 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/ec2-user/app-0.0.1-SNAPSHOT.jar ${{ env.PRESIGNED_URL }}", "ls -l /home/ec2-user/app-0.0.1-SNAPSHOT.jar"]'
|
||||||
|
|
||||||
- name: Create and Start Systemd Service
|
- name: Create and Start Systemd Service
|
||||||
run: |
|
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"]'
|
aws ssm send-command --instance-ids ${{ env.INSTANCE_ID }} --document-name "AWS-RunShellScript" --comment "Create and start service" --parameters 'commands=["sudo bash -c '\''echo -e \"[Unit]\\nDescription=Spring Boot Application\\nAfter=network.target\\n\\n[Service]\\nUser=ec2-user\\nExecStart=/usr/bin/java -jar /home/ec2-user/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"]'
|
||||||
|
|||||||
Reference in New Issue
Block a user