Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible on gitlab ci build only on tag push event?

when I have a project with continuous integration gitlab at the time of making the push automatically tasks that are within the gitlab-ci.yml file are released , what I want is that only in time to make the push of a tag ( git push --follow -tags ) , the tasks of file gitlab-ci.yml - run , is this possible (only git push --follow -tags)?

enter image description here

I refer to this event , but with the build in gitlab ci.

like image 474
allel Avatar asked Jan 07 '16 09:01

allel


People also ask

Are git tags automatically pushed?

Sharing tags is similar to pushing branches. By default, git push will not push tags. Tags have to be explicitly passed to git push . To push multiple tags simultaneously pass the --tags option to git push command.

What is the use of tags in GitLab-CI Yml?

gitlab-ci. yml , you can specify some jobs with the tag testing . If a runner with this tag associated is available, it will pickup the job. In Git, within your repository, tags are used to mark a specific commit.

What is allowed to push in GitLab?

Allowed to push means just that - the user is allowed to git push to the branch. Allowed to merge means that the user is allowed to accept merge requests into that branch.

What does git push -- tags do?

Sharing Tags This process is just like sharing remote branches — you can run git push origin <tagname> . If you have a lot of tags that you want to push up at once, you can also use the --tags option to the git push command. This will transfer all of your tags to the remote server that are not already there.


1 Answers

Solved:

Add to .gitlab-ci.yml tags:

myjob:
  script: test
  only:
  - tags
like image 68
allel Avatar answered Oct 12 '22 15:10

allel