Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v1] gitlab-ci: correct place of tag removement
Date: Thu, 15 Oct 2020 16:08:09 +0300	[thread overview]
Message-ID: <20201015130809.d65bnlbfpfufel2j@tkn_work_nb> (raw)
In-Reply-To: <2ed63567dcfa8bccb6eb8ad85d3fd4d503259131.1602739573.git.avtikhon@tarantool.org>

On Thu, Oct 15, 2020 at 08:27:12AM +0300, Alexander V. Tikhonov wrote:
> Found that branch commited tag removement added in:
> 
>   0f564f3497e6a8afd42da2175104118ba5213593 ("gitlab-ci: remove tag from pushed branch commit")
> 
> must be run after the current workspace was fetched. Also removed not
> needed brackets from command to make it always pass.
> 
> Follows up #3745
> ---
> 
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-3745-force-push-live
> Issue: https://github.com/tarantool/tarantool/issues/3745
> 
>  .gitlab-ci.yml | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 64986e60a..e4e4e64fc 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -21,24 +21,24 @@ variables:
>  #    https://docs.gitlab.com/ee/ci/yaml/README.html#git-submodule-strategy
>  # List of steps:
>  # 1) Check/clone the Tarantool repository with submodules.
> -# 2) Drop a tag that points to a current commit (if any) on a job triggered by
> +# 2) For shell based jobs change ownership of all the sources
> +#    to gitlab-runner user (NOTE: in Docker based jobs the
> +#    gitlab-runner user is not known).
> +# 3) Fetch Tarantool sources with branches and force checkout
> +#    of the testing commit.
> +# 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.
> -# 3) For shell based jobs change ownership of all the sources
> -#    to gitlab-runner user (NOTE: in Docker based jobs the
> -#    gitlab-runner user is not known).
> -# 4) Fetch Tarantool sources with branches and force checkout
> -#    of the testing commit.
>  # 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 "[ -z \"${CI_COMMIT_TAG:-}\" ] && git tag -d \"$(git tag --points-at \"${CI_COMMIT_SHORT_SHA}\")\" 2>/dev/null || true"
>    - /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)"
>    - /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"

Ouch, I missed it and pushed the similar fix:

https://lists.tarantool.org/pipermail/tarantool-patches/2020-October/020242.html

Difference: it wraps a (possibly empty) tag name into quotes and adds
`|| true` to ignore `git tag -d ""` non-zero exit code.

I guess it is better than assume that `git tad -d` will not fail (I
didn't found anything about this case in the manual page).

      reply	other threads:[~2020-10-15 13:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  5:27 Alexander V. Tikhonov
2020-10-15 13:08 ` Alexander Turenko [this message]

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=20201015130809.d65bnlbfpfufel2j@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v1] gitlab-ci: correct place of tag removement' \
    /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