1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-11 05:40:11 +02:00
copilot/bin/deploy

44 lines
1.3 KiB
Plaintext
Raw Normal View History

2016-10-20 16:55:05 +03:00
#! /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
2016-10-21 19:16:18 +03:00
echo ">> Logging into $_DOCKER_REGISTRY"
docker login -e="." -u="$_DOCKER_LOGIN_USERNAME" -p="$_DOCKER_LOGIN_PASSWORD" "$_DOCKER_REGISTRY"
2016-10-21 19:16:18 +03:00
echo ">> Installing captain"
2016-10-21 13:50:37 +03:00
curl -sSL https://raw.githubusercontent.com/tomgco/captain/master/install.sh | bash
export PATH=$HOME/.captain/bin:$PATH
2016-10-21 19:16:18 +03:00
git stash -u
2016-10-21 19:16:18 +03:00
echo ">> running captain build"
captain build -N "$_DOCKER_REGISTRY/yldio/joyent-dashboard-"
2016-10-21 19:16:18 +03:00
echo ">> running captain push"
captain push -N "$_DOCKER_REGISTRY/yldio/joyent-dashboard-"
git stash apply
2016-10-20 16:55:05 +03:00
2016-10-21 19:16:18 +03:00
echo ">> running triton deploy with docker-compose"
ensure_command triton
ensure_triton_cns_is_enabled
get_triton_details
write_env_file
2016-10-20 16:55:05 +03:00
export DOCKER_HOST=$_DOCKER_HOST
export DOCKER_CERT_PATH=$_DOCKER_CERT_PATH
export DOCKER_TLS_VERIFY=$_DOCKER_TLS_VERIFY
docker-compose pull
docker-compose up -d