From 6c9df4afba5acfcc6f0d6bd6135eb3f619bea6e9 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 20 Apr 2021 00:57:46 +0300 Subject: [PATCH 1/7] gitlab-ci.yml --- gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 919b534..c62ae3b 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -27,7 +27,6 @@ sync: - echo "${CI_SERVER_PROTOCOL}://${GIT_PUSH_LOGIN}:${GIT_PUSH_PASSWORD}@${CI_SERVER_HOST}" >> ~/.git-credentials || true - ( test -n "${GIT_LOGIN}" && test -n "${GIT_PASSWORD}" ) && echo "https://${GIT_LOGIN}:${GIT_PASSWORD}@$(echo ${GIT_URL} | sed -r 's#([^/])/[^/].*#\1#' | sed -e 's|https://||g')" >> ~/.git-credentials || true - ( eval $(ssh-agent -s); echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true - - cat ~/.git-credentials - git remote add upstream "${GIT_URL}" && git fetch upstream - git checkout master && git merge upstream/"${GIT_UPSTGREAM_BRANCH}" - git push -- GitLab From 12a19854a0d63897af21466f18c61733c6f7a6d8 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 20 Apr 2021 00:58:35 +0300 Subject: [PATCH 2/7] 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 c62ae3b..84b4886 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -28,5 +28,5 @@ sync: - ( test -n "${GIT_LOGIN}" && test -n "${GIT_PASSWORD}" ) && echo "https://${GIT_LOGIN}:${GIT_PASSWORD}@$(echo ${GIT_URL} | sed -r 's#([^/])/[^/].*#\1#' | sed -e 's|https://||g')" >> ~/.git-credentials || true - ( eval $(ssh-agent -s); echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true - git remote add upstream "${GIT_URL}" && git fetch upstream - - git checkout master && git merge upstream/"${GIT_UPSTGREAM_BRANCH}" + - git checkout --track origin/master && git merge upstream/"${GIT_UPSTGREAM_BRANCH}" - git push -- GitLab From 4e80bfce26fc1f6ca43a4f7fd29f72832f35b409 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 20 Apr 2021 00:59:55 +0300 Subject: [PATCH 3/7] 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 84b4886..6d7ad75 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -28,5 +28,5 @@ sync: - ( test -n "${GIT_LOGIN}" && test -n "${GIT_PASSWORD}" ) && echo "https://${GIT_LOGIN}:${GIT_PASSWORD}@$(echo ${GIT_URL} | sed -r 's#([^/])/[^/].*#\1#' | sed -e 's|https://||g')" >> ~/.git-credentials || true - ( eval $(ssh-agent -s); echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true - git remote add upstream "${GIT_URL}" && git fetch upstream - - git checkout --track origin/master && git merge upstream/"${GIT_UPSTGREAM_BRANCH}" + - git checkout --track origin/master && git merge "upstream/${GIT_UPSTGREAM_BRANCH}" - git push -- GitLab From 5f4e6b8b6e13caa03bc68b06de6413a8544ca6b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 20 Apr 2021 01:17:53 +0300 Subject: [PATCH 4/7] 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 6d7ad75..36882bf 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -24,9 +24,11 @@ sync: - master script: - git config --global credential.helper store && touch ~/.git-credentials + - echo -e "machine ${CI_SERVER_HOST}\nlogin ${GIT_PUSH_LOGIN}\npassword ${GIT_PUSH_PASSWORD}" > ~/.netrc - echo "${CI_SERVER_PROTOCOL}://${GIT_PUSH_LOGIN}:${GIT_PUSH_PASSWORD}@${CI_SERVER_HOST}" >> ~/.git-credentials || true - ( test -n "${GIT_LOGIN}" && test -n "${GIT_PASSWORD}" ) && echo "https://${GIT_LOGIN}:${GIT_PASSWORD}@$(echo ${GIT_URL} | sed -r 's#([^/])/[^/].*#\1#' | sed -e 's|https://||g')" >> ~/.git-credentials || true - ( eval $(ssh-agent -s); echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true + - git checkout --track origin/master && git pull - git remote add upstream "${GIT_URL}" && git fetch upstream - - git checkout --track origin/master && git merge "upstream/${GIT_UPSTGREAM_BRANCH}" + - git pull "upstream/${GIT_UPSTGREAM_BRANCH}" - git push -- GitLab From 591d5a0470f45bdeff8856181e8e289813ee06e4 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 20 Apr 2021 01:18:23 +0300 Subject: [PATCH 5/7] 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 36882bf..20d327d 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -24,11 +24,11 @@ sync: - master script: - git config --global credential.helper store && touch ~/.git-credentials - - echo -e "machine ${CI_SERVER_HOST}\nlogin ${GIT_PUSH_LOGIN}\npassword ${GIT_PUSH_PASSWORD}" > ~/.netrc - echo "${CI_SERVER_PROTOCOL}://${GIT_PUSH_LOGIN}:${GIT_PUSH_PASSWORD}@${CI_SERVER_HOST}" >> ~/.git-credentials || true - ( test -n "${GIT_LOGIN}" && test -n "${GIT_PASSWORD}" ) && echo "https://${GIT_LOGIN}:${GIT_PASSWORD}@$(echo ${GIT_URL} | sed -r 's#([^/])/[^/].*#\1#' | sed -e 's|https://||g')" >> ~/.git-credentials || true - ( eval $(ssh-agent -s); echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true - git checkout --track origin/master && git pull - git remote add upstream "${GIT_URL}" && git fetch upstream - git pull "upstream/${GIT_UPSTGREAM_BRANCH}" + - echo -e "machine ${CI_SERVER_HOST}\nlogin ${GIT_PUSH_LOGIN}\npassword ${GIT_PUSH_PASSWORD}" > ~/.netrc - git push -- GitLab From 8b0d7ae8a687fd2c0a53e24ec32e6b4f113800fe Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 20 Apr 2021 01:23:53 +0300 Subject: [PATCH 6/7] 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 20d327d..f397c6a 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -27,7 +27,7 @@ sync: - echo "${CI_SERVER_PROTOCOL}://${GIT_PUSH_LOGIN}:${GIT_PUSH_PASSWORD}@${CI_SERVER_HOST}" >> ~/.git-credentials || true - ( test -n "${GIT_LOGIN}" && test -n "${GIT_PASSWORD}" ) && echo "https://${GIT_LOGIN}:${GIT_PASSWORD}@$(echo ${GIT_URL} | sed -r 's#([^/])/[^/].*#\1#' | sed -e 's|https://||g')" >> ~/.git-credentials || true - ( eval $(ssh-agent -s); echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true - - git checkout --track origin/master && git pull + - git checkout --track origin/master && git pull --ff-only - git remote add upstream "${GIT_URL}" && git fetch upstream - git pull "upstream/${GIT_UPSTGREAM_BRANCH}" - echo -e "machine ${CI_SERVER_HOST}\nlogin ${GIT_PUSH_LOGIN}\npassword ${GIT_PUSH_PASSWORD}" > ~/.netrc -- GitLab From f5f13a326ce0e394d4e06cf3abe8e57a13798b2a Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 20 Apr 2021 01:27:55 +0300 Subject: [PATCH 7/7] 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 f397c6a..8285563 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -29,6 +29,6 @@ sync: - ( eval $(ssh-agent -s); echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true - git checkout --track origin/master && git pull --ff-only - git remote add upstream "${GIT_URL}" && git fetch upstream - - git pull "upstream/${GIT_UPSTGREAM_BRANCH}" + - git pull --ff-only upstream/${GIT_UPSTGREAM_BRANCH} - echo -e "machine ${CI_SERVER_HOST}\nlogin ${GIT_PUSH_LOGIN}\npassword ${GIT_PUSH_PASSWORD}" > ~/.netrc - git push -- GitLab