Skip to content

Instantly share code, notes, and snippets.

@yriveiro
Forked from RyanHarijanto/.gitlab-ci.yml
Created April 17, 2019 10:14
Show Gist options
  • Save yriveiro/469890a63f71591f3bc85e636f76b59d to your computer and use it in GitHub Desktop.
Save yriveiro/469890a63f71591f3bc85e636f76b59d to your computer and use it in GitHub Desktop.
.gitlab-ci.yml example: multiple Docker images
# The folders below will be cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
- _site # or other arbitrary directory
stages:
- build
- test
- deployterraform
- deploytos3 # you can have more stages
- deploytoelasticbeanstalk
build:
image: node:6-wheezy # or another arbitrary docker image
stage: build
script:
- npm run build # or another arbitrary command
- npm run build2 # or another arbitrary command
test:
image: node:7-wheezy # or another arbitrary docker image
stage: build
script:
- npm run test # or another arbitrary command
# example of applying terraform template
deployterraform:
image: hashicorp/terraform/ # or another arbitrary docker image
stage: deployterraform
script:
- hashicorp/terraform:full apply main.tf # or another arbitrary command
# example of deploying to S3
deploytos3:
image: mikesir87/aws-cli # or another arbitrary docker image
stage: deploytos3
script:
- aws s3 sync . s3://example.com/ --delete # or another arbitrary command
# example of deploying to Elastic Beanstalk
deploytoelasticbeanstalk:
image: lciel/eb-cli # or another arbitrary docker image
stage: deploytoelasticbeanstalk
script:
- eb deploy # or another arbitrary command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment