Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
To: Alexander Turenko <alexander.turenko@tarantool.org>,
	Kirill Yukhin <kyukhin@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v2] gitlab-ci: remove tag from pushed branch commit
Date: Thu, 15 Oct 2020 07:19:31 +0300	[thread overview]
Message-ID: <582864165b996a1a19539a549c6d297caaaac288.1602735537.git.avtikhon@tarantool.org> (raw)

Drop a tag that points to a current commit (if any) on a job triggered
by pushing to a branch (as against of pushing a tag). Otherwise we may
get two jobs for the same x.y.z-0-gxxxxxxxxx build: one is run by
pushing a branch and another by pushing a tag. The idea is to hide the
new tag from the branch job as if a tag would be pushed strictly after
all branch jobs for the same commit.

Closes #3745

Co-authored-by: Alexander Turenko <alexander.turenko@tarantool.org>
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-3745-force-push-live
Issue: https://github.com/tarantool/tarantool/issues/3745

 .gitlab-ci.yml | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d40dc74e3..848855b8e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,12 +26,19 @@ variables:
 #    gitlab-runner user is not known).
 # 3) Fetch Tarantool sources with branches and force checkout
 #    of the testing commit.
-# 4) Update submodules recursively (use force where supports).
-# 5) Cleanup all the sources from all files except from repository.
+# 4) Drop a tag that points to a current commit (if any) on a job triggered by
+#    pushing to a branch (as against of pushing a tag). Otherwise we may get
+#    two jobs for the same x.y.z-0-gxxxxxxxxx build: one is run by pushing a
+#    branch and another by pushing a tag. The idea is to hide the new tag from
+#    the branch job as if a tag would be pushed strictly after all branch jobs
+#    for the same commit. See gh-3745.
+# 5) Update submodules recursively (use force where supports).
+# 6) Cleanup all the sources from all files except from repository.
 before_script:
   - /bin/bash -c "pwd && ls -d .git || git clone --recurse-submodules ${CI_REPOSITORY_URL} ."
   - /bin/bash -c "! docker -v || (uid=`id -u` ; gid=`id -g` ; docker run -w /source -v ${PWD}:/source -i packpack/packpack:el-7 /bin/bash -c \"chown -R \$uid:\$gid * .[^.]*\")"
   - /bin/bash -c "git fetch -p && git checkout -f ${CI_COMMIT_SHORT_SHA}"
+  - /bin/bash -c "[ -z \"${CI_COMMIT_TAG:-}\" ] && git tag -d \"$(git tag --points-at HEAD)\" 2>/dev/null || true"
   - /bin/bash -c "git submodule sync --recursive && git submodule update --force --init --recursive || git submodule update --recursive --init"
   - /bin/bash -c "git clean -ffdx && git submodule foreach git clean -ffdx && git submodule foreach git status"
 
-- 
2.25.1

             reply	other threads:[~2020-10-15  4:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  4:19 Alexander V. Tikhonov [this message]
2020-10-15  9:24 ` Alexander Turenko
2020-10-15 13:03   ` Alexander Turenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=582864165b996a1a19539a549c6d297caaaac288.1602735537.git.avtikhon@tarantool.org \
    --to=avtikhon@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] gitlab-ci: remove tag from pushed branch commit' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox