|
1 | | -# version: 0.2 |
2 | | - |
3 | | -# phases: |
4 | | -# install: |
5 | | -# runtime-versions: |
6 | | -# java: corretto11 |
7 | | -# commands: |
8 | | -# - echo "Skipping yum update..." |
9 | | - |
10 | | -# pre_build: |
11 | | -# commands: |
12 | | -# - echo "Nothing to do in the pre_build phase..." |
13 | | - |
14 | | -# build: |
15 | | -# commands: |
16 | | -# - echo "Build started" |
17 | | -# - mvn clean package |
18 | | - |
19 | | -# post_build: |
20 | | -# commands: |
21 | | -# - echo "Build completed" |
22 | | -# - aws ssm get-parameter --name maddy-test --with-decryption --query "Parameter.Value" --output text > private_key.pem |
23 | | -# - chmod 600 private_key.pem |
24 | | -# # Copy the built WAR file to S3 bucket |
25 | | -# - aws s3 cp /codebuild/output/src*/src/webapp/target/webapp.war s3://tf-test-backend-bucket/webapp.war --sse AES256 --region ap-south-1 |
26 | | - |
27 | | - |
28 | | - |
29 | 1 | version: 0.2 |
30 | 2 |
|
31 | 3 | phases: |
32 | 4 | install: |
33 | 5 | runtime-versions: |
34 | | - nodejs: 14 |
| 6 | + java: corretto11 |
| 7 | + commands: |
| 8 | + - echo "Skipping yum update..." |
| 9 | + |
| 10 | + pre_build: |
| 11 | + commands: |
| 12 | + - echo "Nothing to do in the pre_build phase..." |
35 | 13 |
|
36 | 14 | build: |
37 | 15 | commands: |
38 | | - # Your build commands here if needed |
| 16 | + - echo "Build started" |
| 17 | + - mvn clean package |
39 | 18 |
|
40 | 19 | post_build: |
41 | 20 | commands: |
42 | | - # List objects in the S3 bucket and get the latest one |
43 | | - - LATEST_ARTIFACT=$(aws s3 ls s3://codepipeline-us-east-1-532396540230/cross/SourceArti/ --recursive | sort | tail -n 1 | awk '{print $4}') |
44 | | - # Copy the latest artifact to the EC2 instance |
45 | | - - aws s3 cp "s3://codepipeline-us-east-1-532396540230/$LATEST_ARTIFACT" /tmp/ssm |
46 | | - # Create a text file on the EC2 instance |
47 | | - - aws ssm send-command --document-name "AWS-RunShellScript" --targets "Key=instanceids,Values=i-03b7cf2b2df29bd5d" --parameters commands="echo 'Hello, this is a text file content' > /tmp/ssm/my_text_file.txt" |
| 21 | + - echo "Build completed" |
| 22 | + # - aws ssm get-parameter --name maddy-test --with-decryption --query "Parameter.Value" --output text > private_key.pem |
| 23 | + # - chmod 600 private_key.pem |
| 24 | + # # Copy the built WAR file to S3 bucket |
| 25 | + # - aws s3 cp /codebuild/output/src*/src/webapp/target/webapp.war s3://tf-test-backend-bucket/webapp.war --sse AES256 --region ap-south-1 |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +# version: 0.2 |
| 30 | + |
| 31 | +# phases: |
| 32 | +# install: |
| 33 | +# runtime-versions: |
| 34 | +# nodejs: 14 |
| 35 | + |
| 36 | +# build: |
| 37 | +# commands: |
| 38 | +# # Your build commands here if needed |
| 39 | + |
| 40 | +# post_build: |
| 41 | +# commands: |
| 42 | +# # List objects in the S3 bucket and get the latest one |
| 43 | +# - LATEST_ARTIFACT=$(aws s3 ls s3://codepipeline-us-east-1-532396540230/cross/SourceArti/ --recursive | sort | tail -n 1 | awk '{print $4}') |
| 44 | +# # Copy the latest artifact to the EC2 instance |
| 45 | +# - aws s3 cp "s3://codepipeline-us-east-1-532396540230/$LATEST_ARTIFACT" /tmp/ssm |
| 46 | +# # Create a text file on the EC2 instance |
| 47 | +# - aws ssm send-command --document-name "AWS-RunShellScript" --targets "Key=instanceids,Values=i-03b7cf2b2df29bd5d" --parameters commands="echo 'Hello, this is a text file content' > /tmp/ssm/my_text_file.txt" |
0 commit comments