From 7be25cf921d9da509a1cd04151ebf604818bc1b0 Mon Sep 17 00:00:00 2001 From: Tom Gallacher Date: Mon, 31 Oct 2016 14:51:21 +0000 Subject: [PATCH] circleci: cleanup circle.yml --- bin/deploy | 13 ------------- bin/push-images | 28 ++++++++++++++++++++++++++++ circle.yml | 4 +--- 3 files changed, 29 insertions(+), 16 deletions(-) create mode 100755 bin/push-images diff --git a/bin/deploy b/bin/deploy index 535ded24..6491edf7 100755 --- a/bin/deploy +++ b/bin/deploy @@ -15,19 +15,6 @@ readonly INCLUDE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=bin/setup-tools . "${INCLUDE}"/setup-tools -echo ">> Logging into $_DOCKER_REGISTRY" -docker login -e="." -u="$_DOCKER_LOGIN_USERNAME" -p="$_DOCKER_LOGIN_PASSWORD" "$_DOCKER_REGISTRY" -echo ">> Installing captain" -curl -sSL https://raw.githubusercontent.com/tomgco/captain/master/install.sh | bash -export PATH=$HOME/.captain/bin:$PATH - -git stash -u -echo ">> running captain build" -captain build -N "$_DOCKER_REGISTRY/yldio/joyent-dashboard-" -echo ">> running captain push" -captain push -N "$_DOCKER_REGISTRY/yldio/joyent-dashboard-" - - echo ">> running triton deploy with docker-compose" ensure_command triton ensure_triton_cns_is_enabled diff --git a/bin/push-images b/bin/push-images new file mode 100755 index 00000000..1c7ffd60 --- /dev/null +++ b/bin/push-images @@ -0,0 +1,28 @@ +#! /usr/bin/env bash + +# +# Prelude - make bash behave sanely +# http://redsymbol.net/articles/unofficial-bash-strict-mode/ +# +set -euo pipefail + +# Beware of CDPATH gotchas causing cd not to work correctly when a user +# has set this in their environment +# https://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/ +unset CDPATH + +readonly INCLUDE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# shellcheck source=bin/setup-tools +. "${INCLUDE}"/setup-tools + +echo ">> Logging into $_DOCKER_REGISTRY" +docker login -e="." -u="$_DOCKER_LOGIN_USERNAME" -p="$_DOCKER_LOGIN_PASSWORD" "$_DOCKER_REGISTRY" +echo ">> Installing captain" +curl -sSL https://raw.githubusercontent.com/tomgco/captain/master/install.sh | bash +export PATH=$HOME/.captain/bin:$PATH + +git stash -u +echo ">> running captain build" +captain build -N "$_DOCKER_REGISTRY/yldio/joyent-dashboard-" +echo ">> running captain push" +captain push -N "$_DOCKER_REGISTRY/yldio/joyent-dashboard-" diff --git a/circle.yml b/circle.yml index 78815b21..6d1ba847 100644 --- a/circle.yml +++ b/circle.yml @@ -17,12 +17,9 @@ machine: version: 6.9.1 dependencies: - cache_directories: - - "/opt/circleci/python/2.7.11/lib/python2.7/site-packages" pre: - sudo curl -L https://github.com/docker/compose/releases/download/1.8.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - - docker-compose -v - yarn global add triton - echo '{"url":"https://eu-ams-1.api.joyent.com","account":"'$SDC_ACCOUNT'","keyId":"c3:30:35:9b:85:48:73:44:31:cc:4b:2e:6a:00:16:e2","name":"eu-ams-1","curr":true}' | triton profile create -f - - mkdir -p ${CIRCLE_TEST_REPORTS}/tap-xunit/ @@ -37,6 +34,7 @@ deployment: production: # just a label; label names are completely up to you branch: master commands: + - ./bin/push-images - ./bin/deploy ## Custom notifications