我是新手,正尝试使用S3和AWS代码部署将jar从jar部署到AWS。 在每次对位存储桶进行提交后,我运行以下命令:
- aws deploy push --application-name ApplicationName
--description "This is my deployment"
--ignore-hidden-files
--s3-location s3://project-code-testing/EmailSend.zip
- aws deploy create-deployment
--application-name ApplicationName
--deployment-config-name CodeDeployDefault.OneAtATime
--deployment-group-name ApplicationGroup
--s3-location bucket=bucketName,key=EmailSend.zip,bundleType=zip
appspec.yml
version: 0.0
os: redhat
files:
- source: /home/ec2-user/codes/EmailSend/target/EmailSend-0.0.1-SNAPSHOT.jar
destination: /home/ec2-user/deployed
hooks:
ApplicationStart:
- location: runapp.sh
runas: ubuntu
runapp.sh
#!/usr/bin/env bash
cd '/home/ec2-user/deployed'
java -jar EmailSend-0.0.1-SNAPSHOT.jar &
请帮助我进行设置。