From 6d9df9ef2c0356612904d9094d8612a51904fce9 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Mon, 24 Apr 2017 17:29:09 +0800 Subject: [PATCH 01/10] 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 929ef1362f..20e7b77be9 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 0000000000..425e41d004 --- /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 02/10] 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 20e7b77be9..b827e39683 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 425e41d004..f701c22eed 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 From e4994f0f4e1d19c8398bc8be7c61061d7eb451a3 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Mon, 24 Apr 2017 17:29:09 +0800 Subject: [PATCH 03/10] Push collector docker image when sky-walking released --- .travis.yml | 1 + travis/push_image.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 travis/push_image.sh diff --git a/.travis.yml b/.travis.yml index 929ef1362f..b827e39683 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,4 @@ script: after_success: - mvn clean cobertura:cobertura coveralls:report + - bash ./travis/push_image.sh diff --git a/travis/push_image.sh b/travis/push_image.sh new file mode 100644 index 0000000000..f701c22eed --- /dev/null +++ b/travis/push_image.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +check_pull_is_release() { + if [ "${TRAVIS_TAG}" = "" ]; then + return 1 + else + echo "[Pushing] pushing docker image of ${TRAVIS_TAG}." + return 0 + fi + +} + +push_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_release; then + push_collector_image + echo "[Pushing] push Done!" +fi \ No newline at end of file From be901d52feb913556c46b55a4f78aff57110059a Mon Sep 17 00:00:00 2001 From: zhangxin Date: Mon, 24 Apr 2017 23:58:15 +0800 Subject: [PATCH 04/10] Push the collector docker image when sky-walking is tagged --- travis/push_image.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/travis/push_image.sh b/travis/push_image.sh index f701c22eed..598633439c 100644 --- a/travis/push_image.sh +++ b/travis/push_image.sh @@ -1,10 +1,10 @@ #!/bin/sh -check_pull_is_release() { +check_pull_is_tagged() { if [ "${TRAVIS_TAG}" = "" ]; then return 1 else - echo "[Pushing] pushing docker image of ${TRAVIS_TAG}." + echo "Push the collector image of ${TRAVIS_TAG} version." return 0 fi @@ -18,7 +18,7 @@ push_collector_image() { } -if check_pull_is_release; then +if check_pull_is_tagged; then push_collector_image - echo "[Pushing] push Done!" + echo "Push is Done!" fi \ No newline at end of file From 86f22f7e83123f8777d976bc496e21c2c8166928 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Tue, 25 Apr 2017 13:48:12 +0800 Subject: [PATCH 05/10] fix the image name of collector issue and push docker images when skywalking is tagged and the branch is master --- .../skywalking-collector-worker/pom.xml | 2 +- travis/push_image.sh | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/skywalking-collector/skywalking-collector-worker/pom.xml b/skywalking-collector/skywalking-collector-worker/pom.xml index fdae9454e6..1045cb7159 100644 --- a/skywalking-collector/skywalking-collector-worker/pom.xml +++ b/skywalking-collector/skywalking-collector-worker/pom.xml @@ -101,7 +101,7 @@ ${docker.plugin.version} false - ${docker.cache.imageName} + skywalking/${docker.cache.imageName} ${docker.imageTag.version} diff --git a/travis/push_image.sh b/travis/push_image.sh index 598633439c..a9f82f123d 100644 --- a/travis/push_image.sh +++ b/travis/push_image.sh @@ -1,13 +1,19 @@ #!/bin/sh check_pull_is_tagged() { - if [ "${TRAVIS_TAG}" = "" ]; then + if [ "${TRAVIS_TAG}" == "" ]; then return 1 else - echo "Push the collector image of ${TRAVIS_TAG} version." return 0 fi +} +check_branch_is_master(){ + if [ "${TRAVIS_BRANCH}" == "master" ]; then + return 0; + else + return 1; + fi } push_collector_image() { @@ -18,7 +24,7 @@ push_collector_image() { } -if check_pull_is_tagged; then +if check_pull_is_tagged && check_branch_is_master; then push_collector_image echo "Push is Done!" fi \ No newline at end of file From 0fe22b3b84395bb358f13c1798865ba8af4d1cd0 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Tue, 25 Apr 2017 14:17:48 +0800 Subject: [PATCH 06/10] add docker service --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index b827e39683..69492c5060 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,8 @@ +sudo: required + +services: + - docker + language: java install: - cd ci-dependencies From 29c72d25959c2785dcc1af34d3764da6832990b0 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Tue, 25 Apr 2017 13:48:12 +0800 Subject: [PATCH 07/10] fix the image name of collector issue and push docker images when skywalking is tagged and the branch is master --- .travis.yml | 5 +++++ .../skywalking-collector-worker/pom.xml | 2 +- travis/push_image.sh | 12 +++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index b827e39683..69492c5060 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,8 @@ +sudo: required + +services: + - docker + language: java install: - cd ci-dependencies diff --git a/skywalking-collector/skywalking-collector-worker/pom.xml b/skywalking-collector/skywalking-collector-worker/pom.xml index fdae9454e6..1045cb7159 100644 --- a/skywalking-collector/skywalking-collector-worker/pom.xml +++ b/skywalking-collector/skywalking-collector-worker/pom.xml @@ -101,7 +101,7 @@ ${docker.plugin.version} false - ${docker.cache.imageName} + skywalking/${docker.cache.imageName} ${docker.imageTag.version} diff --git a/travis/push_image.sh b/travis/push_image.sh index 598633439c..a9f82f123d 100644 --- a/travis/push_image.sh +++ b/travis/push_image.sh @@ -1,13 +1,19 @@ #!/bin/sh check_pull_is_tagged() { - if [ "${TRAVIS_TAG}" = "" ]; then + if [ "${TRAVIS_TAG}" == "" ]; then return 1 else - echo "Push the collector image of ${TRAVIS_TAG} version." return 0 fi +} +check_branch_is_master(){ + if [ "${TRAVIS_BRANCH}" == "master" ]; then + return 0; + else + return 1; + fi } push_collector_image() { @@ -18,7 +24,7 @@ push_collector_image() { } -if check_pull_is_tagged; then +if check_pull_is_tagged && check_branch_is_master; then push_collector_image echo "Push is Done!" fi \ No newline at end of file From 5c40e46228c0bfc9a679cf9c9dc4a52d0fe9d324 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Tue, 25 Apr 2017 13:48:12 +0800 Subject: [PATCH 08/10] fix the image name of collector issue and push docker images when skywalking is tagged and the branch is master --- .travis.yml | 5 +++++ .../skywalking-collector-worker/pom.xml | 2 +- travis/push_image.sh | 12 +++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index b827e39683..69492c5060 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,8 @@ +sudo: required + +services: + - docker + language: java install: - cd ci-dependencies diff --git a/skywalking-collector/skywalking-collector-worker/pom.xml b/skywalking-collector/skywalking-collector-worker/pom.xml index fdae9454e6..1045cb7159 100644 --- a/skywalking-collector/skywalking-collector-worker/pom.xml +++ b/skywalking-collector/skywalking-collector-worker/pom.xml @@ -101,7 +101,7 @@ ${docker.plugin.version} false - ${docker.cache.imageName} + skywalking/${docker.cache.imageName} ${docker.imageTag.version} diff --git a/travis/push_image.sh b/travis/push_image.sh index 598633439c..a9f82f123d 100644 --- a/travis/push_image.sh +++ b/travis/push_image.sh @@ -1,13 +1,19 @@ #!/bin/sh check_pull_is_tagged() { - if [ "${TRAVIS_TAG}" = "" ]; then + if [ "${TRAVIS_TAG}" == "" ]; then return 1 else - echo "Push the collector image of ${TRAVIS_TAG} version." return 0 fi +} +check_branch_is_master(){ + if [ "${TRAVIS_BRANCH}" == "master" ]; then + return 0; + else + return 1; + fi } push_collector_image() { @@ -18,7 +24,7 @@ push_collector_image() { } -if check_pull_is_tagged; then +if check_pull_is_tagged && check_branch_is_master; then push_collector_image echo "Push is Done!" fi \ No newline at end of file From c762b2333cf7a0d062e0c15ffd5918c1a2974d7a Mon Sep 17 00:00:00 2001 From: zhangxin Date: Tue, 25 Apr 2017 23:39:49 +0800 Subject: [PATCH 09/10] Push the collector docker image when sky-walking is tagged --- travis/push_image.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/travis/push_image.sh b/travis/push_image.sh index a9f82f123d..8c284cce9f 100644 --- a/travis/push_image.sh +++ b/travis/push_image.sh @@ -4,27 +4,31 @@ check_pull_is_tagged() { if [ "${TRAVIS_TAG}" == "" ]; then return 1 else + echo "This build was started by the tag ${TRAVIS_TAG}, push image" return 0 fi } -check_branch_is_master(){ - if [ "${TRAVIS_BRANCH}" == "master" ]; then - return 0; - else - return 1; +check_release_tag() { + tag="${TRAVIS_TAG}" + if [[ "$tag" =~ ^v[0-9.]*-[0-9]{4}$ ]]; then + return 0; + else + echo "The provided tag ${tag} doesn't match that." + return 1; fi } -push_collector_image() { +push_image() { + IMAGE_VERSION=`echo ${TRAVIS_TAG:1}` 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} + docker push skywalking/skywalking-collector:${IMAGE_VERSION} } -if check_pull_is_tagged && check_branch_is_master; then - push_collector_image +if check_pull_is_tagged && check_release_tag; then + push_image echo "Push is Done!" fi \ No newline at end of file From 3b2b4d786a8f4cc82b949635a4182eff42c89cdb Mon Sep 17 00:00:00 2001 From: zhangxin Date: Wed, 26 Apr 2017 14:32:29 +0800 Subject: [PATCH 10/10] modify the properties key of docker configuration for increase readability --- skywalking-collector/skywalking-collector-worker/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/skywalking-collector/skywalking-collector-worker/pom.xml b/skywalking-collector/skywalking-collector-worker/pom.xml index 1045cb7159..5e4ee972ca 100644 --- a/skywalking-collector/skywalking-collector-worker/pom.xml +++ b/skywalking-collector/skywalking-collector-worker/pom.xml @@ -15,8 +15,8 @@ 9.4.2.v20170220 com.a.eye.skywalking.collector.worker.CollectorBootStartUp - skywalking-collector - ${version} + skywalking/${artifactId} + ${version} @@ -101,9 +101,9 @@ ${docker.plugin.version} false - skywalking/${docker.cache.imageName} + ${docker.image.name} - ${docker.imageTag.version} + ${docker.image.version} ${project.basedir}/docker