Skip to content

Instantly share code, notes, and snippets.

@scari
Created November 30, 2015 16:34
Show Gist options
  • Save scari/d8ee241dda331664555b to your computer and use it in GitHub Desktop.
Save scari/d8ee241dda331664555b to your computer and use it in GitHub Desktop.
#!/bin/bash
# Excerpts from https://enterprise.travis-ci.com/install/worker
#
populate_images() {
DOCKER_CMD="docker -H tcp://0.0.0.0:2375"
# pick the languages you are interested in
langs='android erlang go haskell jvm node-js perl php python ruby'
declare -a lang_mappings=('clojure:jvm' 'scala:jvm' 'groovy:jvm' 'java:jvm' 'elixir:erlang' 'node_js:node-js')
tag=latest
for lang in $langs; do
$DOCKER_CMD pull quay.io/travisci/travis-$lang:$tag
$DOCKER_CMD tag -f quay.io/travisci/travis-$lang:$tag travis:$lang
done
# tag travis:ruby as travis:default
$DOCKER_CMD tag -f travis:ruby travis:default
for lang_map in "${lang_mappings[@]}"; do
map=$(echo $lang_map|cut -d':' -f 1)
lang=$(echo $lang_map|cut -d':' -f 2)
$DOCKER_CMD tag -f quay.io/travisci/travis-$lang:$tag travis:$map
done
}
populate_images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment