From 3796a93a4ca23ff1f46789679b98366306620464 Mon Sep 17 00:00:00 2001 From: an Date: Wed, 21 Feb 2018 11:10:09 +0000 Subject: [PATCH 01/13] =?UTF-8?q?'.drone.yml'=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index e70556b..c48b8fd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,7 @@ pipeline: build: image: golang:1.6 environment: - - FOO=1 + - FOO=2 commands: - go get -a -v - make test From 2f8300c357fdfc5ad80cf02888eff64cbe88820b Mon Sep 17 00:00:00 2001 From: an Date: Wed, 21 Feb 2018 11:11:10 +0000 Subject: [PATCH 02/13] =?UTF-8?q?'.drone.yml'=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c48b8fd..0e578b0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,7 @@ pipeline: build: image: golang:1.6 environment: - - FOO=2 + - FOO=3 commands: - go get -a -v - make test From 00915d9a8d9c5040230e3229dae661c8bcdddc68 Mon Sep 17 00:00:00 2001 From: an Date: Wed, 21 Feb 2018 11:13:22 +0000 Subject: [PATCH 03/13] =?UTF-8?q?'.drone.yml'=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0e578b0..98d2969 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,5 +5,5 @@ pipeline: - FOO=3 commands: - go get -a -v - - make test - - make build \ No newline at end of file + - go test + - go build \ No newline at end of file From 0946b4016e970007200ff4bc9ef0eeabf5128830 Mon Sep 17 00:00:00 2001 From: an Date: Wed, 21 Feb 2018 11:40:00 +0000 Subject: [PATCH 04/13] =?UTF-8?q?'.drone.yml'=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 98d2969..b60e76e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,7 @@ pipeline: build: image: golang:1.6 environment: - - FOO=3 + - FOO=4 commands: - go get -a -v - go test From 63850ba27cd5a9dcaaa4f1aa009b5d7654d1a018 Mon Sep 17 00:00:00 2001 From: an Date: Wed, 21 Feb 2018 11:42:28 +0000 Subject: [PATCH 05/13] =?UTF-8?q?'.drone.yml'=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index b60e76e..0e73c52 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,7 @@ pipeline: build: image: golang:1.6 environment: - - FOO=4 + - FOO=5 commands: - go get -a -v - go test From 5e1eeab7d4819efae1055d28b5f398c1cfebbc34 Mon Sep 17 00:00:00 2001 From: an Date: Wed, 21 Feb 2018 22:23:37 +0000 Subject: [PATCH 06/13] =?UTF-8?q?'.drone.yml'=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 0e73c52..6afbac5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,7 @@ pipeline: build: image: golang:1.6 environment: - - FOO=5 + - FOO=6 commands: - go get -a -v - go test From 21e48598f2b9516cb547f8271105cd6f97b961e5 Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Thu, 22 Feb 2018 09:36:57 +0100 Subject: [PATCH 07/13] Removed vendor --- .gitmodules | 6 ------ vendor/git.dnix.de/an/flokatilib | 1 - vendor/git.dnix.de/an/xlog | 1 - 3 files changed, 8 deletions(-) delete mode 160000 vendor/git.dnix.de/an/flokatilib delete mode 160000 vendor/git.dnix.de/an/xlog diff --git a/.gitmodules b/.gitmodules index e126cdc..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +0,0 @@ -[submodule "vendor/git.dnix.de/an/xlog"] - path = vendor/git.dnix.de/an/xlog - url = https://git.dnix.de/an/xlog -[submodule "vendor/git.dnix.de/an/flokatilib"] - path = vendor/git.dnix.de/an/flokatilib - url = https://git.dnix.de/an/flokatilib diff --git a/vendor/git.dnix.de/an/flokatilib b/vendor/git.dnix.de/an/flokatilib deleted file mode 160000 index 3c7b7e5..0000000 --- a/vendor/git.dnix.de/an/flokatilib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3c7b7e572723ac26e7f821dfd3528c0d04253faa diff --git a/vendor/git.dnix.de/an/xlog b/vendor/git.dnix.de/an/xlog deleted file mode 160000 index e754765..0000000 --- a/vendor/git.dnix.de/an/xlog +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e7547652aef671a5acb3fa66625b007c2c75251c From a6dc5ba86de824ba1fb5a61a0f41e3d22a4a85f0 Mon Sep 17 00:00:00 2001 From: an Date: Thu, 22 Feb 2018 16:43:08 +0000 Subject: [PATCH 08/13] Testing '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 6afbac5..3cde42a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,6 +4,6 @@ pipeline: environment: - FOO=6 commands: - - go get -a -v + - go get -d ./... - go test - go build \ No newline at end of file From b4e828694e1fff87150da7a69262febf52cf2b00 Mon Sep 17 00:00:00 2001 From: an Date: Thu, 22 Feb 2018 16:48:04 +0000 Subject: [PATCH 09/13] Testing '.drone.yml' --- .drone.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3cde42a..9393bf2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,8 +2,7 @@ pipeline: build: image: golang:1.6 environment: - - FOO=6 + - FOO=1 commands: - go get -d ./... - - go test - go build \ No newline at end of file From 02155191d498cc3b3b94a0290a659f0e983204d8 Mon Sep 17 00:00:00 2001 From: an Date: Thu, 22 Feb 2018 16:50:02 +0000 Subject: [PATCH 10/13] Testing '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 9393bf2..3a9b560 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ pipeline: build: - image: golang:1.6 + image: golang:1.9 environment: - FOO=1 commands: From ea8cd38da061554270369ee865d977008d16ddaa Mon Sep 17 00:00:00 2001 From: an Date: Thu, 22 Feb 2018 17:15:55 +0000 Subject: [PATCH 11/13] Testing '.drone.yml' --- .drone.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 3a9b560..0a5538e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,5 +4,26 @@ pipeline: environment: - FOO=1 commands: + - export REV=$(git rev-list HEAD --count) + - export BUILDDATE=$(date) + - export BRANCH=$DRONE_COMMIT_BRANCH + - export IMAGE=dr.dnix.de/$DRONE_REPO_NAME + - export VERSIONGO=version.go + - echo "Building image $IMAGE:$BRANCH-$REV" + - echo "package main" >$VERSIONGO + - echo "" >>$VERSIONGO + - echo "const (" >>$VERSIONGO + - echo -n " FlokatiVersion = \"" >>$VERSIONGO + - echo -n "$BRANCH" >>$VERSIONGO + - echo "\"" >>$VERSIONGO + - echo -n " FlokatiBuild = \"" >>$VERSIONGO + - echo -n "$REV" >>$VERSIONGO + - echo "\"" >>$VERSIONGO + - echo -n " FlokatiBuilddate = \"" >>$VERSIONGO + - echo -n "$BUILDDATE" >>$VERSIONGO + - echo "\"" >>$VERSIONGO + - echo ")" >>$VERSIONGO + - cat version.go - go get -d ./... - - go build \ No newline at end of file + - go build + \ No newline at end of file From b9e4c86e0eff2685e10eeaaff5a84e8730420201 Mon Sep 17 00:00:00 2001 From: an Date: Thu, 22 Feb 2018 17:48:37 +0000 Subject: [PATCH 12/13] =?UTF-8?q?'.drone.yml'=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 0a5538e..cb052ad 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,7 +23,7 @@ pipeline: - echo -n "$BUILDDATE" >>$VERSIONGO - echo "\"" >>$VERSIONGO - echo ")" >>$VERSIONGO - - cat version.go + - #cat version.go - go get -d ./... - go build \ No newline at end of file From a300310666129f68c0b76153fbeb70d9e7ed294c Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Fri, 23 Feb 2018 16:44:16 +0100 Subject: [PATCH 13/13] ... --- .drone.yml | 83 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 29 deletions(-) diff --git a/.drone.yml b/.drone.yml index cb052ad..b8b0879 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,29 +1,54 @@ -pipeline: - build: - image: golang:1.9 - environment: - - FOO=1 - commands: - - export REV=$(git rev-list HEAD --count) - - export BUILDDATE=$(date) - - export BRANCH=$DRONE_COMMIT_BRANCH - - export IMAGE=dr.dnix.de/$DRONE_REPO_NAME - - export VERSIONGO=version.go - - echo "Building image $IMAGE:$BRANCH-$REV" - - echo "package main" >$VERSIONGO - - echo "" >>$VERSIONGO - - echo "const (" >>$VERSIONGO - - echo -n " FlokatiVersion = \"" >>$VERSIONGO - - echo -n "$BRANCH" >>$VERSIONGO - - echo "\"" >>$VERSIONGO - - echo -n " FlokatiBuild = \"" >>$VERSIONGO - - echo -n "$REV" >>$VERSIONGO - - echo "\"" >>$VERSIONGO - - echo -n " FlokatiBuilddate = \"" >>$VERSIONGO - - echo -n "$BUILDDATE" >>$VERSIONGO - - echo "\"" >>$VERSIONGO - - echo ")" >>$VERSIONGO - - #cat version.go - - go get -d ./... - - go build - \ No newline at end of file + pipeline: + prebuild: + image: golang:1.9 + commands: + - IMAGE=dr.dnix.de/$DRONE_REPO_NAME + - REV=$(git rev-list HEAD --count) + - BUILDDATE=$(date) + - BRANCH=$DRONE_COMMIT_BRANCH + - VERSIONGO=version.go + - TAGS=.tags + - echo "Building image $IMAGE:$BRANCH-$REV" + - echo "package main" >$VERSIONGO + - echo "" >>$VERSIONGO + - echo "const (" >>$VERSIONGO + - echo -n " FlokatiVersion = \"" >>$VERSIONGO + - echo -n "$BRANCH" >>$VERSIONGO + - echo "\"" >>$VERSIONGO + - echo -n " FlokatiBuild = \"" >>$VERSIONGO + - echo -n "$REV" >>$VERSIONGO + - echo "\"" >>$VERSIONGO + - echo -n " FlokatiBuilddate = \"" >>$VERSIONGO + - echo -n "$BUILDDATE" >>$VERSIONGO + - echo "\"" >>$VERSIONGO + - echo ")" >>$VERSIONGO + - cat $VERSIONGO + - echo -n "$BRANCH-$REV" >$TAGS + - cat $TAGS + build_docker: + image: plugins/docker + repo: dr.dnix.de/${DRONE_REPO_NAME} + tags: + - latest + deploy: + image: ubuntu:16.04 + commands: + - apt update + - apt -y upgrade + - apt install -y git + - IMAGE=dr.dnix.de/$DRONE_REPO_NAME + - BRANCH=$DRONE_COMMIT_BRANCH + - REV=$(git rev-list HEAD --count) + - echo "Deploying image $IMAGE:$BRANCH-$REV" + - cd ~ + - mkdir .ssh + - chmod 700 .ssh + - echo K8S_SSH_PRIVATE_KEY >.ssh/id_rsa + - chmod 600 .ssh/id_rsa + - echo K8S_SSH_PUBLIC_KEY >.ssh/id_rsa.pub + - chmod 600 .ssh/id_rsa.pub + - ssh -oStrictHostKeyChecking=no root@master01 "kubectl set image deployment/mmflokati-flokati mmflokati-flokati=dr.dnix.de/mmflokati:$BRANCH-$REV -n northbrigade" + - ssh -oStrictHostKeyChecking=no root@master01 "kubectl set image deployment/mmflokati-armleuchter mmflokati-armleuchter=dr.dnix.de/mmflokati:$BRANCH-$REV -n northbrigade" + - ssh -oStrictHostKeyChecking=no root@master01 "kubectl rollout status deployment/mmflokati-flokati -n northbrigade" + - ssh -oStrictHostKeyChecking=no root@master01 "kubectl rollout status deployment/mmflokati-armleuchter -n northbrigade" +