Answers: <p>Within the project</p>
  
  <ul>
  <li>go to <em>CI / CD</em> -> <em>Pipelines</em></li>
  <li>press <em>Run Pipeline</em></li>
  <li>under <em>Create for</em> choose the branch or tag you want to run the pipeline for</li>
  <li>press <em>Create Pipeline</em></li>
  </ul>
  
  <p>Now to trigger a manual Job you can use the jobs of the recently created pipeline.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-05-16T07:41:42.323Z
Answers: 2019-05-16T07:41:42.323Z
Answers: smoe
Body: <p>I can build from a specific old tag in teamity.
  Screenshot:
  <a href="https://i.sstatic.net/WTdwR.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WTdwR.png" alt="enter image description here"></a></p>
  
  <p>How to run a build from a specific old tag in gitlab ci?</p>
  
  <pre><code>variables:
    MAVEN_OPTS: "-Djava.awt.headless=true -Dmaven.repo.local=.m2/repository"
    MAVEN_CLI_OPTS: "-s maven_settings.xml --batch-mode --errors --fail-at-end --show-version"
  
  stages:
    - build
    - release
    - build-tag
  
  build:
    stage: build
    script:
      - mvn $MAVEN_CLI_OPTS -Dmaven.test.skip=true clean install -PRPM -U
  
  release:
    stage: release
    script:
      - eval $(ssh-agent)
      - ssh-add &lt;(echo "$SSH_PRIVATE_KEY")
      - git config user.name "$PUSH_USER_NAME"
      - git config user.email "$PUSH_USER_EMAIL"
      - git checkout master
      - git reset --hard origin/master
      - mvn $MAVEN_CLI_OPTS clean release:prepare -Dresume=false -DautoVersionSubmodules=true -DdryRun=false -Dmaven.test.skip=true
    when: manual
  
  build-tag:
    stage: build-tag
    script:
      - git checkout master
      - git pull
      - git reset --hard $(git describe --abbrev=0 --tags)
      - mvn $MAVEN_CLI_OPTS -Dmaven.test.skip=true clean install -PRPM -U
    when: manual
  </code></pre>
  
  <p>build-tag i dont see in pipeline</p>
  
  <p>How to run a build from a specific old tag in gitlab ci?</p>
  
  <p><a href="https://i.sstatic.net/sZZcB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sZZcB.png" alt="enter image description here"></a></p>
  
Comments: CC BY-SA 4.0
Comments: 2019-05-16T07:52:23.257Z
Comments: Your pipeline is somehow messed up. You are not supposed to take care of which code-revision you are building on in the jobs. the whole git-stuff seems wrong to me.
  Gitlab takes care of the code itself and always provides a clean codebase to all jobs. if you want to carry over artifacts from previous jobs you should use *artifacts* and *dependencies* https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html
Comments: smoe
Tags: <gitlab><maven>
Title: How to run a build from a specific old tag in gitlab ci?
UserDisplayName: Anton Patsev
ThreadText: # How to run a build from a specific old tag in gitlab ci?
  
  (Asked by: username_0 on 2019-05-16)
  
  I can build from a specific old tag in teamity.
  Screenshot:
  [![enter image description here](https://i.sstatic.net/WTdwR.png)](https://i.sstatic.net/WTdwR.png)
  
  How to run a build from a specific old tag in gitlab ci?
  
  ```
  variables:
    MAVEN_OPTS: "-Djava.awt.headless=true -Dmaven.repo.local=.m2/repository"
    MAVEN_CLI_OPTS: "-s maven_settings.xml --batch-mode --errors --fail-at-end --show-version"
  
  stages:
    - build
    - release
    - build-tag
  
  build:
    stage: build
    script:
      - mvn $MAVEN_CLI_OPTS -Dmaven.test.skip=true clean install -PRPM -U
  
  release:
    stage: release
    script:
      - eval $(ssh-agent)
      - ssh-add <(echo "$SSH_PRIVATE_KEY")
      - git config user.name "$PUSH_USER_NAME"
      - git config user.email "$PUSH_USER_EMAIL"
      - git checkout master
      - git reset --hard origin/master
      - mvn $MAVEN_CLI_OPTS clean release:prepare -Dresume=false -DautoVersionSubmodules=true -DdryRun=false -Dmaven.test.skip=true
    when: manual
  
  build-tag:
    stage: build-tag
    script:
      - git checkout master
      - git pull
      - git reset --hard $(git describe --abbrev=0 --tags)
      - mvn $MAVEN_CLI_OPTS -Dmaven.test.skip=true clean install -PRPM -U
    when: manual
  
  ```
  
  build-tag i dont see in pipeline
  
  How to run a build from a specific old tag in gitlab ci?
  
  [![enter image description here](https://i.sstatic.net/sZZcB.png)](https://i.sstatic.net/sZZcB.png)
  
  **Tags:** gitlab, maven
  
  > **Comments:**
  > **username_1**: Your pipeline is somehow messed up. You are not supposed to take care of which code-revision you are building on in the jobs. the whole git-stuff seems wrong to me. Gitlab takes care of the code itself and always provides a clean codebase to all jobs. if you want to carry over artifacts from previous jobs you should use *artifacts* and *dependencies* https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-16. Score: 1 | Accepted answer
  
  Within the project
  
  * go to *CI / CD* -> *Pipelines*
  * press *Run Pipeline*
  * under *Create for* choose the branch or tag you want to run the pipeline for
  * press *Create Pipeline*
  
  Now to trigger a manual Job you can use the jobs of the recently created pipeline.
  
  
  ---
  
  