From f0014a083dae9018a8327225b6f225666a84a2bb Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 18:10:18 +0000 Subject: [PATCH 01/39] :construction_worker: Add new file --- .gitlab-ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ef33943 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,15 @@ +stages: + - build + + +build_frontend: + stage: build + image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build + before_script: + - cp -r src/ /workdir/src/ + script: + - pwd + - ls -la + - cd /workdir + - npm run build + - ls -la /workdir/public From 30929c60f7d030df6ba94b5f746429a68e8306a5 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:14:18 +0000 Subject: [PATCH 02/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef33943..adf6148 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - - cp -r src/ /workdir/src/ + - cp -r /Frontend/src/ /workdir/src/ script: - pwd - ls -la From 95ea0e935abb9375bf1452db17879506ca1a68d3 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:15:46 +0000 Subject: [PATCH 03/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index adf6148..4e313d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - - cp -r /Frontend/src/ /workdir/src/ + - cp -r Frontend/src/ /workdir/src/ script: - pwd - ls -la From 1535bb0e21c91db9bfe26dbe65617053f2149a73 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:17:20 +0000 Subject: [PATCH 04/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4e313d4..1579c93 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ build_frontend: image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - cp -r Frontend/src/ /workdir/src/ + - cp -r Frontend/public/ /workdir/public/ script: - pwd - ls -la From 849140bd5486064290b7d731baaa9b97f06d689b Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:38:17 +0000 Subject: [PATCH 05/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1579c93..c965275 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: + - echo "${DEPLOY_ENV_KEY}" >> /workdir/deploy_key - cp -r Frontend/src/ /workdir/src/ - cp -r Frontend/public/ /workdir/public/ script: @@ -13,4 +14,7 @@ build_frontend: - ls -la - cd /workdir - npm run build - - ls -la /workdir/public + - ls -la /workdir/build + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET -i /workdir/deploy_key "mkdir -p /opt/serve/" + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET -i /workdir/deploy_key "rm -rf /opt/serve/*" + - rsync --progress -av -e "ssh -i /workdir/deploy_key" /workdir/build $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/opt/serve/ From ff4d67bfe198b25d4330d264997581709dfc54e9 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:41:38 +0000 Subject: [PATCH 06/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c965275..85d22e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ build_frontend: image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - echo "${DEPLOY_ENV_KEY}" >> /workdir/deploy_key + - cat /workdir/deploy_key - cp -r Frontend/src/ /workdir/src/ - cp -r Frontend/public/ /workdir/public/ script: From bc4629ea67e979e1411f8dcd342b9292511c1c49 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:42:23 +0000 Subject: [PATCH 07/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85d22e3..b3bfc5d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - - echo "${DEPLOY_ENV_KEY}" >> /workdir/deploy_key + - echo "$DEPLOY_ENV_KEY" >> /workdir/deploy_key - cat /workdir/deploy_key - cp -r Frontend/src/ /workdir/src/ - cp -r Frontend/public/ /workdir/public/ From ff38e43576e77bbbcd4b6f1d4731cebb4358fd3d Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:43:32 +0000 Subject: [PATCH 08/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b3bfc5d..c965275 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,8 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - - echo "$DEPLOY_ENV_KEY" >> /workdir/deploy_key - - cat /workdir/deploy_key + - echo "${DEPLOY_ENV_KEY}" >> /workdir/deploy_key - cp -r Frontend/src/ /workdir/src/ - cp -r Frontend/public/ /workdir/public/ script: From 2625465071e493cc880442a64ac1f3112934ea3d Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:46:57 +0000 Subject: [PATCH 09/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c965275..1ad7ec8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: + - echo "${DEPLOY_ENV_KEY}" - echo "${DEPLOY_ENV_KEY}" >> /workdir/deploy_key - cp -r Frontend/src/ /workdir/src/ - cp -r Frontend/public/ /workdir/public/ From d0a85eb60cb6f4f99f78246ff97e1d75707684a3 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:48:21 +0000 Subject: [PATCH 10/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ad7ec8..85d22e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,8 +6,8 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - - echo "${DEPLOY_ENV_KEY}" - echo "${DEPLOY_ENV_KEY}" >> /workdir/deploy_key + - cat /workdir/deploy_key - cp -r Frontend/src/ /workdir/src/ - cp -r Frontend/public/ /workdir/public/ script: From 3e34d3cf1ac197cb0fde7e90e019364896486481 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:54:17 +0000 Subject: [PATCH 11/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85d22e3..2fceb00 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,9 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - - echo "${DEPLOY_ENV_KEY}" >> /workdir/deploy_key + - echo "${DEPLOY_ENV_KEY}" > /workdir/deploy_key + - echo "${SSH_KNOWN_HOSTS}"> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts - cat /workdir/deploy_key - cp -r Frontend/src/ /workdir/src/ - cp -r Frontend/public/ /workdir/public/ From abcd2e95fd914593ab145441d4028f5d0df42015 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 19:57:25 +0000 Subject: [PATCH 12/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2fceb00..d7a4943 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ build_frontend: image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - echo "${DEPLOY_ENV_KEY}" > /workdir/deploy_key + - mkdir -p ~/.ssh - echo "${SSH_KNOWN_HOSTS}"> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts - cat /workdir/deploy_key From f777c10353ee2eb44b32682ce8e95a81b1b04c52 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 20:00:57 +0000 Subject: [PATCH 13/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d7a4943..485854b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,10 +7,7 @@ build_frontend: image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - echo "${DEPLOY_ENV_KEY}" > /workdir/deploy_key - - mkdir -p ~/.ssh - - echo "${SSH_KNOWN_HOSTS}"> ~/.ssh/known_hosts - - chmod 644 ~/.ssh/known_hosts - - cat /workdir/deploy_key + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - cp -r Frontend/src/ /workdir/src/ - cp -r Frontend/public/ /workdir/public/ script: From ac1c31beb788eb8845bad642d3722af22ef0a8e4 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 20:01:44 +0000 Subject: [PATCH 14/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 485854b..c48194c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ build_frontend: image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - echo "${DEPLOY_ENV_KEY}" > /workdir/deploy_key + - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - cp -r Frontend/src/ /workdir/src/ - cp -r Frontend/public/ /workdir/public/ From 92bb8351dcb03cd8a982853c8b9d9707809aa839 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 20:02:51 +0000 Subject: [PATCH 15/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c48194c..4d7f21c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ build_frontend: image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - echo "${DEPLOY_ENV_KEY}" > /workdir/deploy_key + - chmod 644 /workdir/deploy_key - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - cp -r Frontend/src/ /workdir/src/ From 479a4d2d8185ef8f7f4ec6d653e38c556249130a Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Wed, 8 May 2019 20:03:46 +0000 Subject: [PATCH 16/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d7f21c..be3dc02 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ build_frontend: image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - echo "${DEPLOY_ENV_KEY}" > /workdir/deploy_key - - chmod 644 /workdir/deploy_key + - chmod 600 /workdir/deploy_key - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - cp -r Frontend/src/ /workdir/src/ From a6f323c8eb5c2dcef343fbee0d0cc39150971345 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 16:49:41 +0000 Subject: [PATCH 17/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be3dc02..2f76bfd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,8 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - - echo "${DEPLOY_ENV_KEY}" > /workdir/deploy_key - - chmod 600 /workdir/deploy_key + - ssh-add <(${DEPLOY_ENV_KEY}) - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - cp -r Frontend/src/ /workdir/src/ @@ -18,6 +17,6 @@ build_frontend: - cd /workdir - npm run build - ls -la /workdir/build - - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET -i /workdir/deploy_key "mkdir -p /opt/serve/" - - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET -i /workdir/deploy_key "rm -rf /opt/serve/*" - - rsync --progress -av -e "ssh -i /workdir/deploy_key" /workdir/build $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/opt/serve/ + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "mkdir -p /home/$DEPLOY_ENV_USER/serve" + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "rm -rf /home/$DEPLOY_ENV_USER/serve/*" + - rsync --progress -av -e ssh /workdir/build $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/serve From 6fa231ac3c0826df6246348830d54d109d51eb2d Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 16:50:42 +0000 Subject: [PATCH 18/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f76bfd..de0f9e9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - - ssh-add <(${DEPLOY_ENV_KEY}) + - ssh-add <(echo "${DEPLOY_ENV_KEY}") - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - cp -r Frontend/src/ /workdir/src/ From 3509439dfb0fb4624393e3a52f95844b6e6a4eda Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 16:51:48 +0000 Subject: [PATCH 19/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index de0f9e9..04047a1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: + - eval $(ssh-agent -s) - ssh-add <(echo "${DEPLOY_ENV_KEY}") - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' From 4ccc812f359094a5ead3662f1d2e66087348628d Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 16:54:58 +0000 Subject: [PATCH 20/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04047a1..73dc03e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,4 +20,4 @@ build_frontend: - ls -la /workdir/build - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "mkdir -p /home/$DEPLOY_ENV_USER/serve" - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "rm -rf /home/$DEPLOY_ENV_USER/serve/*" - - rsync --progress -av -e ssh /workdir/build $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/serve + - rsync --progress -av -e ssh /workdir/build/* $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/serve/$CI_COMMIT_REF_NAME/ From 4d3422b39d8a443acba736c371e523dd0885d18d Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 16:56:33 +0000 Subject: [PATCH 21/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 73dc03e..e4417b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,4 +20,5 @@ build_frontend: - ls -la /workdir/build - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "mkdir -p /home/$DEPLOY_ENV_USER/serve" - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "rm -rf /home/$DEPLOY_ENV_USER/serve/*" + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "mkdir -p /home/$DEPLOY_ENV_USER/serve/$CI_COMMIT_REF_NAME" - rsync --progress -av -e ssh /workdir/build/* $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/serve/$CI_COMMIT_REF_NAME/ From ba0ed4a900b8eaf99d5e7d9e98bf5a4251d56d53 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:03:58 +0000 Subject: [PATCH 22/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4417b2..fc5519c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ stages: build_frontend: stage: build + tags: docker image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - eval $(ssh-agent -s) @@ -22,3 +23,7 @@ build_frontend: - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "rm -rf /home/$DEPLOY_ENV_USER/serve/*" - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "mkdir -p /home/$DEPLOY_ENV_USER/serve/$CI_COMMIT_REF_NAME" - rsync --progress -av -e ssh /workdir/build/* $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/serve/$CI_COMMIT_REF_NAME/ + +build_docker_host: + stage: build + From f985a69de905096b6f1338e2e1718c807e38f7ff Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:04:19 +0000 Subject: [PATCH 23/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc5519c..dc44e2a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,8 @@ stages: build_frontend: stage: build - tags: docker + tags: + - docker image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - eval $(ssh-agent -s) From 1fde6401780f0a3bf191a4cb105212e75d91641c Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:05:05 +0000 Subject: [PATCH 24/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dc44e2a..02c731c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,4 +27,6 @@ build_frontend: build_docker_host: stage: build + script: + - echo "todo" From 93fd8d871e0f81456d635f770ad93b0e83f46d7f Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:15:10 +0000 Subject: [PATCH 25/39] Update .gitlab-ci.yml, Docker/Dockerfile_FE_Host files --- .gitlab-ci.yml | 7 ++++++- Docker/Dockerfile_FE_Host | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 02c731c..f978010 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,11 @@ build_frontend: build_docker_host: stage: build + tags: + - docker-builder + before_script: + - docker info script: - - echo "todo" + - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . + - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve diff --git a/Docker/Dockerfile_FE_Host b/Docker/Dockerfile_FE_Host index 0425bbc..a6ab77c 100644 --- a/Docker/Dockerfile_FE_Host +++ b/Docker/Dockerfile_FE_Host @@ -2,5 +2,4 @@ FROM nginx -COPY Frontend/dist /usr/share/nginx/html COPY Docker/config/nginx.conf /etc/nginx/nginx.conf From b515e5a7a77b3234171d73735f93e0a607ccc02b Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:17:50 +0000 Subject: [PATCH 26/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f978010..16d67ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,6 +31,7 @@ build_docker_host: - docker-builder before_script: - docker info + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve From 0eeaeb077d8ee97c1267bb4fe125c9ced7c25e2a Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:34:15 +0000 Subject: [PATCH 27/39] Update .gitlab-ci.yml, Docker/config/restart-host.sh files --- .gitlab-ci.yml | 15 +++++++++++++++ Docker/config/restart-host.sh | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 Docker/config/restart-host.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 16d67ee..abba566 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,4 +35,19 @@ build_docker_host: script: - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve + when: + - manual + + build_docker_builder: + stage: build + tags: + - docker-builder + before_script: + - docker info + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + script: + - docker build -f Docker/Dockerfile_FE_Builder -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build . + - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build + when: + - manual diff --git a/Docker/config/restart-host.sh b/Docker/config/restart-host.sh new file mode 100644 index 0000000..8bbabfe --- /dev/null +++ b/Docker/config/restart-host.sh @@ -0,0 +1,7 @@ +#! /bin/bash +docker login -u gitlab+deploy-token-66068 -p vD23SzzitUn8y8xGknKz registry.gitlab.com +docker stop eva_frontend_serve +docker rm eva_frontend_serve +docker rmi registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve +docker run -d -p 8083:80 -v /home/gitlab/serve:/usr/share/nginx/html:ro --name "eva_frontend_serve" registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve + From 786af31d9fd9270874f4a5ad3e04974c0f2f6177 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 19:35:23 +0200 Subject: [PATCH 28/39] :truck: File permissions --- Docker/config/restart-host.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 Docker/config/restart-host.sh diff --git a/Docker/config/restart-host.sh b/Docker/config/restart-host.sh old mode 100644 new mode 100755 From e6aa36948f0ae88c572094c5a412ef07cf2f2003 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:35:39 +0000 Subject: [PATCH 29/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index abba566..b21970d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,11 +30,17 @@ build_docker_host: tags: - docker-builder before_script: + - eval $(ssh-agent -s) + - ssh-add <(echo "${DEPLOY_ENV_KEY}") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - docker info - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve + - rsync --progress -av -e ssh /Docker/config/restart-host.sh:$DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "./restart-host.sh" when: - manual From 743e32885bb049738609f51c258b1bf132baca35 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:36:32 +0000 Subject: [PATCH 30/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b21970d..03b501a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,7 +44,7 @@ build_docker_host: when: - manual - build_docker_builder: +build_docker_builder: stage: build tags: - docker-builder From cd5d32af4d20111788d8ec30604dd871c236af63 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:37:58 +0000 Subject: [PATCH 31/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03b501a..57a440c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,8 +41,7 @@ build_docker_host: - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve - rsync --progress -av -e ssh /Docker/config/restart-host.sh:$DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "./restart-host.sh" - when: - - manual + when: manual build_docker_builder: stage: build @@ -54,6 +53,5 @@ build_docker_builder: script: - docker build -f Docker/Dockerfile_FE_Builder -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build - when: - - manual + when: manual From 895a6376b7f3652f2be804b8de0f63df60d3c582 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:39:30 +0000 Subject: [PATCH 32/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57a440c..e4412ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ build_docker_host: script: - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve - - rsync --progress -av -e ssh /Docker/config/restart-host.sh:$DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh + - rsync --progress -av -e ssh Docker/config/restart-host.sh:$DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "./restart-host.sh" when: manual From 7d439075b69c36d015363bdc28b2d18c6f7d9bc5 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:43:06 +0000 Subject: [PATCH 33/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4412ab..897cabc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,6 +39,7 @@ build_docker_host: script: - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve + - ls -la Docker/config/restart-host.sh - rsync --progress -av -e ssh Docker/config/restart-host.sh:$DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "./restart-host.sh" when: manual From cd887b4fb61ed37db655591d26a465905cccec94 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:45:12 +0000 Subject: [PATCH 34/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 897cabc..7b7cf6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,7 @@ build_docker_host: - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve - ls -la Docker/config/restart-host.sh - - rsync --progress -av -e ssh Docker/config/restart-host.sh:$DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh + - rsync --progress -av -e ssh Docker/config/restart-host.sh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "./restart-host.sh" when: manual From 0b146033669b07c01cc5112388cfb96ec492fcfa Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:48:28 +0000 Subject: [PATCH 35/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b7cf6d..23d08f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,7 @@ build_docker_host: - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve - ls -la Docker/config/restart-host.sh + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "" # Add host key - rsync --progress -av -e ssh Docker/config/restart-host.sh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "./restart-host.sh" when: manual From 6e63b481630e15ca19c99a08a6f075702a095768 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:50:00 +0000 Subject: [PATCH 36/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23d08f7..6f6804f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,7 @@ build_docker_host: - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve - ls -la Docker/config/restart-host.sh - - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "" # Add host key + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "echo ''" # Add host key - rsync --progress -av -e ssh Docker/config/restart-host.sh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "./restart-host.sh" when: manual From 233aa04817de925da355c2b44ee05cc7ee978e9c Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:52:23 +0000 Subject: [PATCH 37/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f6804f..cb52edc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,14 +33,13 @@ build_docker_host: - eval $(ssh-agent -s) - ssh-add <(echo "${DEPLOY_ENV_KEY}") - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - docker info - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - docker build -f Docker/Dockerfile_FE_Host -t registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve . - docker push registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-serve - ls -la Docker/config/restart-host.sh - - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "echo ''" # Add host key - rsync --progress -av -e ssh Docker/config/restart-host.sh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/restart-host.sh - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "./restart-host.sh" when: manual From ad6a2404d7b92ecb368977c2b48c526e46e3bcad Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 17:53:25 +0000 Subject: [PATCH 38/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb52edc..7253dc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,7 +33,7 @@ build_docker_host: - eval $(ssh-agent -s) - ssh-add <(echo "${DEPLOY_ENV_KEY}") - mkdir -p ~/.ssh - - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - docker info - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: From 02a5e125a230efbd3e0e6fd85c1addeede404010 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 18:10:07 +0000 Subject: [PATCH 39/39] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7253dc2..9878aa6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,7 @@ build_frontend: - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "mkdir -p /home/$DEPLOY_ENV_USER/serve" - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "rm -rf /home/$DEPLOY_ENV_USER/serve/*" - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "mkdir -p /home/$DEPLOY_ENV_USER/serve/$CI_COMMIT_REF_NAME" - - rsync --progress -av -e ssh /workdir/build/* $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/serve/$CI_COMMIT_REF_NAME/ + - rsync --progress -av -e ssh /workdir/build/* $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/serve/ build_docker_host: stage: build