Skip to content
Snippets Groups Projects
Commit 4d030e17 authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

main

parent dbaabe17
No related branches found
No related tags found
No related merge requests found
...@@ -15,8 +15,8 @@ variables: ...@@ -15,8 +15,8 @@ variables:
value: "" value: ""
description: "1.2) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем ssh-ключ репозитория нашего форка" description: "1.2) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем ssh-ключ репозитория нашего форка"
GIT_PUSH_BRANCH: GIT_PUSH_BRANCH:
value: "master" value: "main"
description: "1.3) НЕобязательная переменная: указываем branch (master) репозитория нашего форка" description: "1.3) НЕобязательная переменная: указываем branch (main) репозитория нашего форка"
GIT_PULL_REPO: GIT_PULL_REPO:
value: "" value: ""
description: "2.1) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем адрес репозитория оригинала" description: "2.1) ОБЯЗАТЕЛЬНАЯ ПЕРЕМЕННАЯ: указываем адрес репозитория оригинала"
...@@ -24,8 +24,8 @@ variables: ...@@ -24,8 +24,8 @@ variables:
value: "" value: ""
description: "2.2) НЕобязательная переменная: указываем ssh-ключ репозитория оригинала" description: "2.2) НЕобязательная переменная: указываем ssh-ключ репозитория оригинала"
GIT_PULL_BRANCH: GIT_PULL_BRANCH:
value: "master" value: "main"
description: "2.3) НЕобязательная переменная: указываем branch (master) репозитория оригинала" description: "2.3) НЕобязательная переменная: указываем branch (main) репозитория оригинала"
########################################################################################################## ##########################################################################################################
...@@ -50,11 +50,11 @@ sync: ...@@ -50,11 +50,11 @@ sync:
- test -n "${GIT_PULL_PRIVATE_KEY}" && echo "${GIT_PULL_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null || true - test -n "${GIT_PULL_PRIVATE_KEY}" && echo "${GIT_PULL_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null || true
- test -n "${GIT_PUSH_PRIVATE_KEY}" && echo "${GIT_PUSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null || true - test -n "${GIT_PUSH_PRIVATE_KEY}" && echo "${GIT_PUSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null || true
script: script:
- echo "[${GIT_PULL_REPO}#${GIT_PULL_BRANCH:-master}] -> [${GIT_PUSH_REPO}#${GIT_PUSH_BRANCH:-master}]" - echo "[${GIT_PULL_REPO}#${GIT_PULL_BRANCH:-main}] -> [${GIT_PUSH_REPO}#${GIT_PUSH_BRANCH:-main}]"
- rm -rf /tmp/repo - rm -rf /tmp/repo
- git clone "${GIT_PULL_REPO}" -b "${GIT_PULL_BRANCH:-master}" /tmp/repo - git clone "${GIT_PULL_REPO}" -b "${GIT_PULL_BRANCH:-main}" /tmp/repo
- cd /tmp/repo - cd /tmp/repo
- test -n "${GIT_TAGS}" && git fetch --tags || true - test -n "${GIT_TAGS}" && git fetch --tags || true
- git remote add downstream "${GIT_PUSH_REPO}" - git remote add downstream "${GIT_PUSH_REPO}"
- git push --force downstream "${GIT_PUSH_BRANCH:-master}" - git push --force downstream "${GIT_PUSH_BRANCH:-main}"
- test -n "${GIT_TAGS}" && git push --force downstream --tags || true - test -n "${GIT_TAGS}" && git push --force downstream --tags || true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment