Skip to content

Commit 09f2c03

Browse files
bvennamVincent
authored and
Vincent
committed
publish to docker (#596)
* publish to docker * chmod 755 * spacing * docker_user * provider script instead of after script
1 parent d31e3ad commit 09f2c03

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

.travis.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ before_deploy:
2929
- export RELEASE_PKG_FILE=$(ls $build_file_name-*.*)
3030
- echo "Deploying $RELEASE_PKG_FILE to GitHub releases."
3131
deploy:
32-
provider: releases
32+
- provider: releases
3333
api_key:
3434
secure: aQGcP7XKlgZEFZ57y4RzYRHfQAM5HEdaa7Y/vTxNepIsE7zY2945qT99UJnU1hfhSjP9jO5eNlHzo+AqJoUx70+iUIhMTyOp39Qp7wb74OKolkXwcntufzP7Ocron5IYUE311tf/kic3vRb5cwoaE2lGfx5PdCuozVjgpsDbIRvV5quQzNr68Toqe+yegKwAhprYRWHPnuIqGbkfa83csqFv6m0viC/gvtFOCB9/4zGCqk/K3CKrcr/5GvnFPxJoaJNfFA6umSZ9VaJjbIJmcXGD3nU+rWP0uEpvzGKIMYhmQq/0JuUTgvh4jnnT4OVZeTh6pMaUqtWH+3HDrOiLAiLjcfeT91j7ZXPnx8LvM6SuoRlvRCuXA2FYx9mz2Vx0TWV5TMqhj3okVO/CvvnMMWwKWOUDD/nSMLy93BM40NjD7zimGjocPsGAjTT9H1PSfau3fiiMjg6iMRWjUTfNY5ra5Wgb7W5G37XaCBJDBZL77Blq/tNWdV5qW4A3l4FWnH+LwOdTdhU35Lr5JWzMuEDdkvVgEv8AQjb07P/ODtBW6z3GRv9Rslg9T9ylxkgJpXoYwdXCbtYU8GNcFdJiDpTaVHrkMeLvHrBTRrDCSnCnRFc3AxsUtLklo7R/EX1wUoX+QcAGjh/AmJ4nJVP1C09913fx96WczkRX6ANg2Mw=
3535
file_glob: true
@@ -40,6 +40,13 @@ deploy:
4040
repo: apache/incubator-openwhisk-wskdeploy
4141
tags: true
4242
condition: "$DEPLOY_BUILD_READY = true"
43+
- provider: script
44+
skip_cleanup: true
45+
script: "./tools/travis/docker/publish.sh openwhisk wskdeploy ${TRAVIS_TAG}"
46+
on:
47+
repo: apache/incubator-openwhisk-wskdeploy
48+
tags: true
49+
condition: "$DEPLOY_BUILD_READY = true"
4350
env:
4451
global:
4552
- BLUEMIX_APIHOST=openwhisk.ng.bluemix.net

tools/travis/docker/Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM openwhisk/nodejs6action
2+
3+
RUN apt-get update \
4+
&& apt-get install -y git \
5+
&& npm install --save simple-git js-yaml
6+
7+
COPY wskdeploy /nodejsAction/

tools/travis/docker/publish.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -eu
3+
4+
SCRIPTDIR=$(cd $(dirname "$0") && pwd)
5+
6+
dockerhub_image_prefix="$1"
7+
dockerhub_image_name="$2"
8+
dockerhub_image_tag="$3"
9+
dockerhub_image="${dockerhub_image_prefix}/${dockerhub_image_name}:${dockerhub_image_tag}"
10+
11+
docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
12+
13+
cp $TRAVIS_BUILD_DIR/build/linux/wskdeploy $SCRIPTDIR/
14+
15+
echo docker build $SCRIPTDIR --tag ${dockerhub_image}
16+
docker build $SCRIPTDIR --tag ${dockerhub_image}
17+
18+
echo docker push ${dockerhub_image}
19+
docker push ${dockerhub_image}

0 commit comments

Comments
 (0)