Created
August 4, 2020 15:21
-
-
Save aalonzolu/e5098cb7d2858018ce964b1a796bc599 to your computer and use it in GitHub Desktop.
Deploy app from gitlab to AWS Beanstalk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- build | |
- deploy | |
build: | |
image: aalonzolu/nodeawsdeploy | |
only: | |
- master | |
stage: build | |
allow_failure: false | |
script: | |
- zip -r _app.zip . -x *.git* | |
artifacts: | |
paths: | |
- _app.zip | |
deploy: | |
image: aalonzolu/nodeawsdeploy | |
only: | |
- master | |
stage: deploy | |
script: | |
- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID | |
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY | |
- aws configure set region $AWS_REGION | |
- aws s3 cp _app.zip s3://$AWS_APP_S3/$AWS_APP_NAME-$CI_PIPELINE_ID.zip | |
- aws elasticbeanstalk create-application-version --application-name $AWS_APP_NAME --version-label $AWS_APP_NAME-$CI_PIPELINE_ID --source-bundle S3Bucket=$AWS_APP_S3,S3Key=$AWS_APP_NAME-$CI_PIPELINE_ID.zip | |
- aws elasticbeanstalk update-environment --application-name $AWS_APP_NAME --environment-name $AWS_ENV_NAME --version-label $AWS_APP_NAME-$CI_PIPELINE_ID | |
dependencies: | |
- build | |
variables: | |
DOCKER_DRIVER: overlay2 | |
DOCKER_HOST: tcp://localhost:2375 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment