Skip to content

Instantly share code, notes, and snippets.

@howtoautomateinth
Created April 10, 2020 12:12
Show Gist options
  • Save howtoautomateinth/0c09b6e8c71158ab80690a8307126ada to your computer and use it in GitHub Desktop.
Save howtoautomateinth/0c09b6e8c71158ab80690a8307126ada to your computer and use it in GitHub Desktop.
image: docker:18
services:
- docker:dind
stages:
- default
- test
- deploy
default:
before_script:
- docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD}
- docker build -t simpleapp .
test:
stage: test
script:
- docker run -p 5000:5000 -d --name simpleapp simpleapp
- docker ps | grep -q simpleapp
deploy:
stage: deploy
script:
- docker tag simpleapp howtoautomateinth/simpleapp-gitlab
- docker push howtoautomateinth/simpleapp-gitlab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment