Loading .gitlab-ci.yml +10 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ variables: SSH_PUSH_PRIVATE_KEY: value: "" description: "1.4) НЕобязательная переменная: указываем ssh-ключ репозитория нашего форка вместо пп. 1.2-1.3" SSH_PUSH_BRANCH: value: "" description: "2.5) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем branch репозитория нашего форка" GIT_PULL_URL: value: "" description: "2.1) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем адрес репозитория оригинала" Loading @@ -32,6 +35,9 @@ variables: SSH_PULL_PRIVATE_KEY: value: "" description: "2.4) НЕобязательная переменная: указываем ssh-ключ репозитория оригинала вместо пп. 2.2-2.3" SSH_PULL_BRANCH: value: "" description: "2.5) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем branch репозитория оригинала" ########################################################################################################## Loading @@ -54,7 +60,7 @@ sync: - ( eval $(ssh-agent -s); echo "$SSH_PULL_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true - ( eval $(ssh-agent -s); echo "$SSH_PUSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true script: - git clone "${GIT_PUSH_URL}" /tmp/repo && cd /tmp/repo - git remote add upstream "${GIT_PULL_URL}" && git fetch upstream - git pull --ff-only upstream "${GIT_UPSTGREAM_BRANCH}" - git push origin - git clone "${GIT_PUSH_URL}" /tmp/repo && cd /tmp/repo && git checkout "${GIT_PUSH_BRANCH}" - git remote add upstream "${GIT_PULL_URL}" && git pull --ff-only upstream "${GIT_PULL_BRANCH}" - git pull --ff-only upstream "${GIT_PULL_BRANCH}" - git push origin "${GIT_PUSH_BRANCH}" Loading
.gitlab-ci.yml +10 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ variables: SSH_PUSH_PRIVATE_KEY: value: "" description: "1.4) НЕобязательная переменная: указываем ssh-ключ репозитория нашего форка вместо пп. 1.2-1.3" SSH_PUSH_BRANCH: value: "" description: "2.5) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем branch репозитория нашего форка" GIT_PULL_URL: value: "" description: "2.1) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем адрес репозитория оригинала" Loading @@ -32,6 +35,9 @@ variables: SSH_PULL_PRIVATE_KEY: value: "" description: "2.4) НЕобязательная переменная: указываем ssh-ключ репозитория оригинала вместо пп. 2.2-2.3" SSH_PULL_BRANCH: value: "" description: "2.5) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем branch репозитория оригинала" ########################################################################################################## Loading @@ -54,7 +60,7 @@ sync: - ( eval $(ssh-agent -s); echo "$SSH_PULL_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true - ( eval $(ssh-agent -s); echo "$SSH_PUSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true script: - git clone "${GIT_PUSH_URL}" /tmp/repo && cd /tmp/repo - git remote add upstream "${GIT_PULL_URL}" && git fetch upstream - git pull --ff-only upstream "${GIT_UPSTGREAM_BRANCH}" - git push origin - git clone "${GIT_PUSH_URL}" /tmp/repo && cd /tmp/repo && git checkout "${GIT_PUSH_BRANCH}" - git remote add upstream "${GIT_PULL_URL}" && git pull --ff-only upstream "${GIT_PULL_BRANCH}" - git pull --ff-only upstream "${GIT_PULL_BRANCH}" - git push origin "${GIT_PUSH_BRANCH}"