Skip to content

Commit

Permalink
enable travis ci automated builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Pouyer committed May 4, 2017
1 parent 7fe6922 commit 4ee947e
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sudo: required

language: ruby

services:
- docker

install: true

script:
- ./build.sh
9 changes: 9 additions & 0 deletions build.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# export ARTIFACT_URL=http://artifacts.stackinabox.io.s3-website-us-east-1.amazonaws.com
export ARTIFACT_URL=http://artifacts.stackinabox.io/urbancode/ibm-ucd-agent-relay
export ARTIFACT_STREAM=dev

export DOCKER_EMAIL=tim.pouyer@gmail.com
export DOCKER_USERNAME=tpouyer
export DOCKER_PASSWORD=74ac9z35
30 changes: 30 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env sh

####
# The following variables must be set in the build.rc file before executing this script
####
ARTIFACT_URL=${ARTIFACT_URL:-http://artifacts.stackinabox.io/urbancode/ibm-udclient}

#source ./build.rc

####
# UCD_VERSION will be read from the stream file on the artifact server so no need to set it
####
echo "artifact stream url: $ARTIFACT_URL/$ARTIFACT_STREAM.txt"
curl -O $ARTIFACT_URL/$ARTIFACT_STREAM.txt
ARTIFACT_VERSION=${ARTIFACT_VERSION:-$(cat $ARTIFACT_STREAM.txt)}
ARTIFACT_DOWNLOAD_URL=${ARTIFACT_DOWNLOAD_URL:-$ARTIFACT_URL/$ARTIFACT_VERSION/udclient-$ARTIFACT_VERSION.zip}

echo "artifact stream url: $ARTIFACT_URL/$ARTIFACT_STREAM.txt"
echo "artifact version: $ARTIFACT_VERSION"
echo "artifact download url: $ARTIFACT_DOWNLOAD_URL"

docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker build --tag="stackinabox/urbancode-deploy-client:$ARTIFACT_STREAM" \
--tag="stackinabox/urbancode-deploy-client:$ARTIFACT_VERSION" \
--build-arg ARTIFACT_DOWNLOAD_URL=$ARTIFACT_DOWNLOAD_URL \
--build-arg ARTIFACT_VERSION=$ARTIFACT_VERSION .

if [ -n "$PUBLISH" ]; then
docker push stackinabox/urbancode-deploy-client:$ARTIFACT_VERSION
fi
1 change: 1 addition & 0 deletions dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.2.3.1.884542

0 comments on commit 4ee947e

Please sign in to comment.