Monthly Archive for: ‘November, 2015’

Continuous Delivery with Travis-CI & Giant Swarm

1

Recently I enhanced my Travis-CI build for Chatty:

  • I create a docker image on the fly
  • I push it to Docker Hub
  • I push it to Giant Swarm and update the chatty-server component

So every time I push a commit to GitHub, just a few minutes later the new version of Chatty is alive at http://chatty-toedter.gigantic.io/.

Here are the relevant parts of my .travis.yml to accomplish this:

sudo: required

services:
  - docker

before_script:
  - curl -O https://downloads.giantswarm.io/swarm/clients/0.24.1/swarm-0.24.1-linux-amd64.tar.gz
  - sudo tar xzf swarm-0.24.1-linux-amd64.tar.gz -C /usr/local/bin

script:
  - docker build -t kaitoedter/chatty .
  - docker login --email="$DOCKER_EMAIL" --username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD"
  - docker push kaitoedter/chatty

  - swarm login $SWARM_USER -p $SWARM_PASSWORD
  - sudo docker tag -f kaitoedter/chatty registry.giantswarm.io/toedter/chatty-boot
  - docker push registry.giantswarm.io/toedter/chatty-boot
  - swarm update chatty/chatty-server

The credentials for Docker Hub and Giant Swarm can be stored in environment variables using the Travis-CI Web UI.