Commit 5e1613e3 authored by Ivan Mazhukin's avatar Ivan Mazhukin

epm ci: get old commits before new in branches; fix push error

parent d564cd47
Pipeline #16932 passed with stage
in 16 seconds
......@@ -17,9 +17,14 @@ if [ ! -f "ipfs/eget-ipfs-db.txt" ]; then
exit 1
fi
# clone repo
git clone "$IPFS_REPO_URL" "$WORKDIR"
cd "$WORKDIR"
# Clone target branch if exists, otherwise clone default and create new branch
if git clone -b "${EPM_VERSION}" "$IPFS_REPO_URL" "$WORKDIR" 2>/dev/null; then
cd "$WORKDIR"
else
git clone "$IPFS_REPO_URL" "$WORKDIR"
cd "$WORKDIR"
git checkout -b "${EPM_VERSION}"
fi
# git setup
git config user.name "Builder Robot"
......@@ -51,7 +56,6 @@ git commit -m "IPFS DB update (pipeline $CI_PIPELINE_ID)" || {
# push to version branch
git remote set-url origin "https://builder-robot:${CI_PUSH_TOKEN}@gitlab.eterfund.ru/etersoft/epm-play-ci-results.git"
git checkout -b "${EPM_VERSION}"
git push origin "${EPM_VERSION}" 2>/dev/null
echo "=== IPFS DB and download log's published ==="
......@@ -17,8 +17,14 @@ if [ "$RESULTS_DIR" != "epm-results" ]; then
META_DIR="${RESULTS_DIR}/meta"
fi
git clone "$RESULTS_REPO_URL" "$WORKDIR"
cd "$WORKDIR"
# Clone target branch if exists, otherwise clone default and create new branch
if git clone -b "${EPM_VERSION}" "$RESULTS_REPO_URL" "$WORKDIR" 2>/dev/null; then
cd "$WORKDIR"
else
git clone "$RESULTS_REPO_URL" "$WORKDIR"
cd "$WORKDIR"
git checkout -b "${EPM_VERSION}"
fi
# git configuration
git config user.name "Builder Robot"
......@@ -46,5 +52,4 @@ git commit -m "CI results (${RESULTS_LABEL}): pipeline $CI_PIPELINE_ID" || {
# push to version branch
git remote set-url origin "https://builder-robot:${CI_PUSH_TOKEN}@gitlab.eterfund.ru/etersoft/epm-play-ci-results.git"
git checkout -b "${EPM_VERSION}"
git push origin "${EPM_VERSION}" 2>/dev/null
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment