Add buildpec for codebuild
This commit is contained in:
parent
8167aaa3b5
commit
5f0ae56032
1 changed files with 20 additions and 0 deletions
20
buildspec.production.yml
Normal file
20
buildspec.production.yml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
version: 0.2
|
||||||
|
|
||||||
|
phases:
|
||||||
|
pre_build:
|
||||||
|
commands:
|
||||||
|
#- echo Logging in to docker hub...
|
||||||
|
- docker login -u $DOCKER_LOGIN_USERNAME -p $DOCKER_LOGIN_PASSWORD
|
||||||
|
build:
|
||||||
|
commands:
|
||||||
|
- echo Build started on `date`
|
||||||
|
- echo Building the Docker image...
|
||||||
|
- docker pull $IMAGE_REPO_NAME:$IMAGE_TAG || true
|
||||||
|
- docker build . -f ./Dockerfile -t $IMAGE_REPO_NAME:$IMAGE_TAG --cache-from $IMAGE_REPO_NAME:$IMAGE_TAG
|
||||||
|
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $IMAGE_REPO_NAME:$IMAGE_TAG
|
||||||
|
- printenv
|
||||||
|
post_build:
|
||||||
|
commands:
|
||||||
|
- echo Build completed on `date`
|
||||||
|
- echo Pushing the Docker image...
|
||||||
|
- docker push $IMAGE_REPO_NAME:$IMAGE_TAG
|
Loading…
Reference in a new issue