diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b180b8f1c6a724f7d281c1be8a693129f07a98a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/roles/ +/.idea/ +*.iml diff --git a/gitlab-ci.yml b/gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..b983efc0c9f6cc44715b27fa4784b1c10e152379 --- /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