November 2019
Intermediate to advanced
408 pages
9h 56m
English
The following code will add a new stage that will build, tag, and finally push the result to the Docker registry:
jobs: include: ... - stage: push script: - cd Chapter04 - docker-compose build server - docker tag thoughts_server:latest <registry>/thoughts-backend:$TRAVIS_BRANCH
This first part builds the final image for the server and tags it with the name of the branch. To deploy it, we will add a deploy section:
- stage: push script: ... - docker tag thoughts_server:latest <registry>/thoughts-backend:$TRAVIS_BRANCH deploy: - provider: script script: docker push <registry>/thoughts-backend:$TRAVIS_BRANCH on: branch: master
The deploy section will execute a script command when the branch is master. Now, our build ...
Read now
Unlock full access