From 6d9df9ef2c0356612904d9094d8612a51904fce9 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Mon, 24 Apr 2017 17:29:09 +0800 Subject: [PATCH 1/2] fix #123 --- .travis.yml | 1 + travis/deploy_image.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 travis/deploy_image.sh diff --git a/.travis.yml b/.travis.yml index 929ef1362..20e7b77be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,4 @@ script: after_success: - mvn clean cobertura:cobertura coveralls:report + - bash ./travis/deploy_image.sh diff --git a/travis/deploy_image.sh b/travis/deploy_image.sh new file mode 100644 index 000000000..425e41d00 --- /dev/null +++ b/travis/deploy_image.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +check_pull_is_tag_or_release() { + if [ "${TRAVIS_TAG}" = "" ]; then + return 1 + else + echo "[Deploying] deploy tag ${TRAVIS_TAG}." + return 0 + fi + +} + +deploy_collector_image() { + docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" + mvn clean package docker:build + docker push skywalking/skywalking-collector:latest + docker push skywalking/skywalking-collector:${TRAVIS_TAG} +} + + +if check_pull_is_tag_or_release; then + deploy_collector_image + echo "[Deploying] deploy Done!" +fi \ No newline at end of file From 38b9256340d50ac991103ef9058010432517cd43 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Mon, 24 Apr 2017 17:53:44 +0800 Subject: [PATCH 2/2] modify deploy to push --- .travis.yml | 2 +- travis/{deploy_image.sh => push_image.sh} | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) rename travis/{deploy_image.sh => push_image.sh} (58%) diff --git a/.travis.yml b/.travis.yml index 20e7b77be..b827e3968 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,4 +13,4 @@ script: after_success: - mvn clean cobertura:cobertura coveralls:report - - bash ./travis/deploy_image.sh + - bash ./travis/push_image.sh diff --git a/travis/deploy_image.sh b/travis/push_image.sh similarity index 58% rename from travis/deploy_image.sh rename to travis/push_image.sh index 425e41d00..f701c22ee 100644 --- a/travis/deploy_image.sh +++ b/travis/push_image.sh @@ -1,16 +1,16 @@ #!/bin/sh -check_pull_is_tag_or_release() { +check_pull_is_release() { if [ "${TRAVIS_TAG}" = "" ]; then return 1 else - echo "[Deploying] deploy tag ${TRAVIS_TAG}." + echo "[Pushing] pushing docker image of ${TRAVIS_TAG}." return 0 fi } -deploy_collector_image() { +push_collector_image() { docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" mvn clean package docker:build docker push skywalking/skywalking-collector:latest @@ -18,7 +18,7 @@ deploy_collector_image() { } -if check_pull_is_tag_or_release; then - deploy_collector_image - echo "[Deploying] deploy Done!" +if check_pull_is_release; then + push_collector_image + echo "[Pushing] push Done!" fi \ No newline at end of file