From b5f910ef4aede3893bbd7180d9cb92d5088f00d9 Mon Sep 17 00:00:00 2001 From: evgeny Date: Mon, 6 May 2019 15:25:29 +0300 Subject: [PATCH 01/17] Edit gitlb-ci config --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4c697d6..6de7f29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,10 +42,10 @@ build_and_publish_docker_images: services: - docker:dind script: - - make build-docker-core - - make build-docker-web-server - - make push-docker-core - - make push-docker-web-server + - make build-docker-core "branch=${CI_COMMIT_REF_NAME}" + - make build-docker-web-server "branch=${CI_COMMIT_REF_NAME}" + - make push-docker-core "branch=${CI_COMMIT_REF_NAME}" + - make push-docker-web-server "branch=${CI_COMMIT_REF_NAME}" only: - develop - master From 2510354b7088ccd30462690433e01bbe7929c928 Mon Sep 17 00:00:00 2001 From: evgeny Date: Tue, 7 May 2019 13:24:29 +0300 Subject: [PATCH 02/17] Edit gitlb-ci config --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6de7f29..d443772 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,6 +49,7 @@ build_and_publish_docker_images: only: - develop - master + - hotfix-fixed-bug-with-gitlabci staging-deploy-to-swarm: stage: deploy-staging From c380b7b1baba5571227336d5e893795130f2ce9d Mon Sep 17 00:00:00 2001 From: evgeny Date: Tue, 7 May 2019 13:58:05 +0300 Subject: [PATCH 03/17] Added this branch in make file --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5289a62..dee98ec 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ serve: # Build a Docker image (the project must be built already) build-docker-%: - if [ "$(branch)" == "master" ] || [ "$(branch)" == "develop" ]; \ + if [ "$(branch)" == "master" ] || [ "$(branch)" == "develop" ] || [ "$(branch)" == "hotfix-fixed-bug-with-gitlabci" ]; \ then \ docker build \ -f "docker/$*/Dockerfile" \ From 159cf159e564f7734067d1d40afe4136ec8c09c6 Mon Sep 17 00:00:00 2001 From: evgeny Date: Wed, 8 May 2019 04:35:56 +0300 Subject: [PATCH 04/17] Edit make file --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dee98ec..03844d2 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,8 @@ serve: # Build a Docker image (the project must be built already) build-docker-%: - if [ "$(branch)" == "master" ] || [ "$(branch)" == "develop" ] || [ "$(branch)" == "hotfix-fixed-bug-with-gitlabci" ]; \ + if [ "$(branch)" == "master" ] || [ "$(branch)" == "develop" ] \ + || [ "$(branch)" == "hotfix-fixed-bug-with-gitlabci" ]; \ then \ docker build \ -f "docker/$*/Dockerfile" \ From 1413e319c399f308a3437b8ac8b6f28f5626c33b Mon Sep 17 00:00:00 2001 From: evgeny Date: Wed, 8 May 2019 04:58:01 +0300 Subject: [PATCH 05/17] Edit make file --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 03844d2..00e23e6 100644 --- a/Makefile +++ b/Makefile @@ -53,8 +53,7 @@ serve: # Build a Docker image (the project must be built already) build-docker-%: - if [ "$(branch)" == "master" ] || [ "$(branch)" == "develop" ] \ - || [ "$(branch)" == "hotfix-fixed-bug-with-gitlabci" ]; \ + if [ "$(branch)" == "hotfix-fixed-bug-with-gitlabci" ] || [ "$(branch)" == "develop" ]; \ then \ docker build \ -f "docker/$*/Dockerfile" \ From cb771aca2799eb71313529dff74fba84e971831e Mon Sep 17 00:00:00 2001 From: evgeny Date: Wed, 8 May 2019 15:04:49 +0300 Subject: [PATCH 06/17] Edit make file --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 00e23e6..5289a62 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ serve: # Build a Docker image (the project must be built already) build-docker-%: - if [ "$(branch)" == "hotfix-fixed-bug-with-gitlabci" ] || [ "$(branch)" == "develop" ]; \ + if [ "$(branch)" == "master" ] || [ "$(branch)" == "develop" ]; \ then \ docker build \ -f "docker/$*/Dockerfile" \ From 2337537b1188a75b289de9a419a01c3aaed5e3f6 Mon Sep 17 00:00:00 2001 From: Andrey Yegorov Date: Fri, 10 May 2019 07:47:31 +0000 Subject: [PATCH 07/17] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d443772..bda786b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,6 +41,8 @@ build_and_publish_docker_images: image: registry.gitlab.com/aelve/codesearch/ci-test-env services: - docker:dind + before_script: + - docker info script: - make build-docker-core "branch=${CI_COMMIT_REF_NAME}" - make build-docker-web-server "branch=${CI_COMMIT_REF_NAME}" From f1b57c3e700919c2040c9a39b333f20a948fa8e3 Mon Sep 17 00:00:00 2001 From: Andrey Yegorov Date: Fri, 10 May 2019 08:33:40 +0000 Subject: [PATCH 08/17] Update Dockerfile --- docker/ci-test-env/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/ci-test-env/Dockerfile b/docker/ci-test-env/Dockerfile index 66d7f32..48e698c 100644 --- a/docker/ci-test-env/Dockerfile +++ b/docker/ci-test-env/Dockerfile @@ -9,7 +9,8 @@ RUN apk --no-cache add \ curl \ wget \ ruby \ - ruby-json + ruby-json \ + docker RUN go get github.com/aelve/codesearch-engine/cmd/... From f77c0a5456a7f3387ab92b670b3a53fcab4d8885 Mon Sep 17 00:00:00 2001 From: evgeny Date: Sat, 11 May 2019 04:33:19 +0300 Subject: [PATCH 09/17] Edit make file --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5289a62..8bd5610 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ build-docker-%: else \ docker build \ -f "docker/$*/Dockerfile" \ - -t "quay.io/aelve/codesearch-$*:latest" . ; \ + -t "quay.io/aelve/codesearch-$*:hotfix-fixed-bug-with-gitlabci" . ; \ fi \ if [ "$(branch)" == "master" ]; \ From 85f1c06f154e15c9454505ae3b86aebed7d10256 Mon Sep 17 00:00:00 2001 From: evgeny Date: Sat, 11 May 2019 14:20:21 +0300 Subject: [PATCH 10/17] Edit gitlb-ci config --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bda786b..fb41f8f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,7 +42,7 @@ build_and_publish_docker_images: services: - docker:dind before_script: - - docker info + - docker login quay.io -u "$DOCKER_USER" -p "$DOCKER_PASS" script: - make build-docker-core "branch=${CI_COMMIT_REF_NAME}" - make build-docker-web-server "branch=${CI_COMMIT_REF_NAME}" From 42d7e3c87a09d68042345a835a33c1c98b4d84b1 Mon Sep 17 00:00:00 2001 From: evgeny Date: Sat, 11 May 2019 15:48:42 +0300 Subject: [PATCH 11/17] Edit gitlb-ci config --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb41f8f..2cc89cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,7 +42,7 @@ build_and_publish_docker_images: services: - docker:dind before_script: - - docker login quay.io -u "$DOCKER_USER" -p "$DOCKER_PASS" + - docker login quay.io -u $DOCKER_USER -p $DOCKER_PASS script: - make build-docker-core "branch=${CI_COMMIT_REF_NAME}" - make build-docker-web-server "branch=${CI_COMMIT_REF_NAME}" From c6fa3e0d9ddf2a8e4333bf3623b57521356954cb Mon Sep 17 00:00:00 2001 From: evgeny Date: Tue, 14 May 2019 03:55:07 +0300 Subject: [PATCH 12/17] Final gitlab-ci config --- .gitlab-ci.yml | 1 - Makefile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2cc89cf..1849b29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,6 @@ build_and_publish_docker_images: only: - develop - master - - hotfix-fixed-bug-with-gitlabci staging-deploy-to-swarm: stage: deploy-staging diff --git a/Makefile b/Makefile index 8bd5610..5289a62 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ build-docker-%: else \ docker build \ -f "docker/$*/Dockerfile" \ - -t "quay.io/aelve/codesearch-$*:hotfix-fixed-bug-with-gitlabci" . ; \ + -t "quay.io/aelve/codesearch-$*:latest" . ; \ fi \ if [ "$(branch)" == "master" ]; \ From 6057a28580567ba7ce2dcc75e6290b3f6bade86c Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 17 May 2019 14:40:58 +0300 Subject: [PATCH 13/17] Testing work ssh --- .gitlab-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1849b29..e32ea85 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - publish - deploy-staging - deploy + - testssh variables: DOCKER_HOST: tcp://docker:2375/ @@ -52,7 +53,14 @@ build_and_publish_docker_images: - develop - master -staging-deploy-to-swarm: +test_work_ssh: + stage: testssh + script: + - ssh deployer@$STAGING_HOST "docker services ls" + only: + - hotfix-fixed-bug-with-gitlabci + +staging_deploy_to_swarm: stage: deploy-staging script: - ssh deployer@$STAGING_HOST "mkdir -p ~/docker && echo $DEPLOYER_PASS | sudo -S mkdir -p /mnt/vol/{portainer/data,postgresql,data,index,logs}" || true @@ -62,7 +70,7 @@ staging-deploy-to-swarm: only: - develop -deploy-to-swarm: +deploy_to_swarm: stage: deploy script: - ssh deployer@$HOST "mkdir -p ~/docker && echo $DEPLOYER_PASS | sudo -S mkdir -p /mnt/vol/{portainer/data,postgresql,data,index,logs}" || true From d6fb1b14e5acb2b6a409977350f26065dfc67c7a Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 17 May 2019 15:39:43 +0300 Subject: [PATCH 14/17] Testing work ssh --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e32ea85..e95b015 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,7 +56,7 @@ build_and_publish_docker_images: test_work_ssh: stage: testssh script: - - ssh deployer@$STAGING_HOST "docker services ls" + - ssh deployer@$HOST "docker services ls" only: - hotfix-fixed-bug-with-gitlabci From 39766daf645c42513e47462b98696c72fdbd5690 Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 17 May 2019 19:01:13 +0300 Subject: [PATCH 15/17] Testing work ssh --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e95b015..fcffc51 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,7 +56,7 @@ build_and_publish_docker_images: test_work_ssh: stage: testssh script: - - ssh deployer@$HOST "docker services ls" + - ssh root@$HOST "docker services ls" only: - hotfix-fixed-bug-with-gitlabci From f8561b7a8ef2b3d21c66ecf035c2c3f63576b670 Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 17 May 2019 19:04:25 +0300 Subject: [PATCH 16/17] Edit gitlb-ci config --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fcffc51..ceb1da3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,6 @@ build_and_test: build_and_publish_docker_images: stage: publish - image: registry.gitlab.com/aelve/codesearch/ci-test-env services: - docker:dind before_script: @@ -52,6 +51,7 @@ build_and_publish_docker_images: only: - develop - master + - hotfix-fixed-bug-with-gitlabci test_work_ssh: stage: testssh From 8171dee970d0ae3b70b738e2a968ef29fbf26e4d Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 17 May 2019 19:19:41 +0300 Subject: [PATCH 17/17] Edit gitlb-ci config --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ceb1da3..2e5e5e2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,12 +51,11 @@ build_and_publish_docker_images: only: - develop - master - - hotfix-fixed-bug-with-gitlabci test_work_ssh: stage: testssh script: - - ssh root@$HOST "docker services ls" + - ssh root@codesearch.aelve.com "docker services ls" only: - hotfix-fixed-bug-with-gitlabci