Skip to content

Instantly share code, notes, and snippets.

@RyanHarijanto
Last active October 4, 2023 21:28
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RyanHarijanto/217d62534260fd2ee63278b3c293cd10 to your computer and use it in GitHub Desktop.
Save RyanHarijanto/217d62534260fd2ee63278b3c293cd10 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: test
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
@pragmaticadam
Copy link

Great example

shouldn't be
stage: test

in line 24?

@awasum
Copy link

awasum commented Jun 15, 2019

Thanks very much.

@Ahrorooney
Copy link

Very nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment