Skip to content

Commit 2b034ac

Browse files
authored
Update buildspec.yml
1 parent 679f5f6 commit 2b034ac

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

buildspec.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
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-
291
version: 0.2
302

313
phases:
324
install:
335
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..."
3513

3614
build:
3715
commands:
38-
# Your build commands here if needed
16+
- echo "Build started"
17+
- mvn clean package
3918

4019
post_build:
4120
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

Comments
 (0)