Skip to content

Commit 5b098c0

Browse files
committed
new changes
1 parent e1bad7d commit 5b098c0

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

buildspec.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
version: 0.2
22

3+
env:
4+
variables:
5+
AWSCOPY: "aws s3 cp s3://docker-ecs-simple/simplewebappdev.war simplewebapp.war"
6+
37
phases:
48
pre_build:
59
commands:
610
- echo Logging in to Amazon ECR...
711
- eval $(aws ecr get-login)
812
build:
913
commands:
10-
- aws s3 cp s3://docker-ecs-simple/simplewebapptest.war simplewebapp.war
14+
- eval $(AWSCOPY)
1115
post_build:
1216
commands:
1317
- echo Build started on `date`

buildspec_dev_build.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 0.2
2+
3+
phases:
4+
pre_build:
5+
commands:
6+
- echo Logging in to Amazon ECR...
7+
- eval $(aws ecr get-login)
8+
build:
9+
commands:
10+
- aws s3 cp s3://docker-ecs-simple/simplewebapptest.war simplewebapp.war
11+
post_build:
12+
commands:
13+
- echo Build started on `date`
14+
- echo Building the Docker image...
15+
- docker build -t simplewebapp --build-arg WEBCONTEXT=$WEBCONTEXT .
16+
- docker tag simplewebapp:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$AWS_REPO_NAME:latest
17+
- echo Build completed on `date`
18+
- echo Pushing the Docker image...
19+
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$AWS_REPO_NAME:latest

0 commit comments

Comments
 (0)