diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..57b1d2d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: bash +os: +- linux +services: +- docker +deploy: + on: + branch: master + tags: true + provider: script + script: bash ./build.sh $CLI_VERSION $TRAVIS_TAG diff --git a/Dockerfile b/Dockerfile index 46d5f98..f8ba853 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ RUN yum -y update && \ yum -y install wget # Matching appsody binary does not exist in upstream. # Provide the proper version once it is available. -RUN wget https://github.com/appsody/appsody/releases/download/0.X.0/appsody-0.X.0-1.x86_64.rpm -RUN yum localinstall -y ./appsody-0.X.0-1.x86_64.rpm +ARG CLI_VERSION +RUN wget https://github.com/appsody/appsody/releases/download/$CLI_VERSION/appsody-$CLI_VERSION-1.x86_64.rpm +RUN yum localinstall -y ./appsody-$CLI_VERSION-1.x86_64.rpm RUN chmod +x extract.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..b7db25b --- /dev/null +++ b/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash +#Takes two parms: +#CLI_VERSION +#TRAVIS_TAG +set -e +#sed -i "s/CLI_VERSION/$1/g" ./Dockerfile +echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin +docker build -t $DOCKER_ORG/appsody-buildah:$2 --build-arg CLI_VERSION=$1 . +docker push $DOCKER_ORG/appsody-buildah:$2 \ No newline at end of file