Commit abd819e6 authored by Дмитрий Сафронов's avatar Дмитрий Сафронов
Browse files

Merge branch 'trunk' into 'master'

Trunk

See merge request tools/continuous-integration/sync-fork!1
parents ac5172fe 050ec397
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+3 −0
Original line number Diff line number Diff line
/roles/
/.idea/
*.iml

gitlab-ci.yml

0 → 100644
+34 −0
Original line number Diff line number Diff line
---

# 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