From 3cafbe3cf9d435bd4d577328609c2df26cdf2396 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 20 Apr 2021 00:28:44 +0300 Subject: [PATCH 1/2] .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b180b8f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/roles/ +/.idea/ +*.iml -- GitLab From 02152db22e71c4a13212ee26e3522a6068f90013 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 20 Apr 2021 00:29:02 +0300 Subject: [PATCH 2/2] gitlab-ci.yml --- gitlab-ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 gitlab-ci.yml diff --git a/gitlab-ci.yml b/gitlab-ci.yml new file mode 100644 index 0000000..b983efc --- /dev/null +++ b/gitlab-ci.yml @@ -0,0 +1,34 @@ +--- + +# VARIABLES +variables: + GIT_DEPTH: 1 + +########################################################################################################## + +## PIPELINE DEFINITION +stages: + - sync + +########################################################################################################## + +### SYNC SECTION +sync: + image: $GIT_IMAGE + stage: sync + except: + refs: + - merge_requests + only: + refs: + - master + script: + - git config --global credential.helper store && touch ~/.git-credentials + - echo "https://${GIT_LOGIN}:${GIT_PASSWORD}@$(echo ${GIT_URL} | sed -r 's#([^/])/[^/].*#\1#' | sed -e 's|https://||g')" >> ~/.git-credentials || true + - echo "https://gitlab-ci-token:${CI_BUILD_TOKEN}@${CI_SERVER_HOST}" >> ~/.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 master + - git remote add upstream "${GIT_URL}" # https://github.com/southbridgeio/kubespray.git + - git fetch upstream + - git pull upstream "${GIT_UPSTGREAM_BRANCH}" # master + - git push -- GitLab