diff --git a/.travis.yml b/.travis.yml index d18302d..57b1d2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,4 @@ deploy: branch: master tags: true provider: script - script: bash ./docker-build.sh + script: bash ./build.sh $CLI_VERSION $TRAVIS_TAG diff --git a/Dockerfile b/Dockerfile index 99c42c9..99c0870 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,11 @@ FROM gcr.io/cloud-builders/docker + RUN apt-get update && \ apt-get -y install sudo jq wget -RUN wget https://github.com/appsody/appsody/releases/download/0.4.0/appsody_0.4.0_amd64.deb + +ARG CLI_VERSION +RUN wget https://github.com/appsody/appsody/releases/download/$CLI_VERSION/appsody_$CLI_VERSION_amd64.deb +RUN apt install -f ./appsody_$CLI_VERSION_amd64.deb + COPY setupAndRunExtract.sh . -RUN apt install -f ./appsody_0.4.0_amd64.deb +RUN chmod +x setupAndRunExtract.sh \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..1b9230d --- /dev/null +++ b/build.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +#Takes two parms: +#CLI_VERSION +#TRAVIS_TAG + +set -e +echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin +docker build -t $DOCKER_ORG/appsody-docker:$2 -t $DOCKER_ORG/appsody-docker:latest --build-arg CLI_VERSION=$1 . +docker push $DOCKER_ORG/appsody-docker \ No newline at end of file diff --git a/docker-build.sh b/docker-build.sh deleted file mode 100755 index 8887d2b..0000000 --- a/docker-build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -e -echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin -docker build -t $DOCKER_ORG/appsody-docker . -docker push $DOCKER_ORG/appsody-docker \ No newline at end of file