# Pipelines in rancher

**URL:** <https://forums.suse.com/t/pipelines-in-rancher/16005>\
**Category:** SUSE Rancher Prime\
**Created:** [December 4, 2019, 9:51am UTC](https://forums.suse.com/t/pipelines-in-rancher/16005 "2019-12-04T09:51:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamlesh](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kamlesh](https://forums.suse.com/u/kamlesh)\
**Post date:** [December 4, 2019, 9:51am UTC](https://forums.suse.com/t/pipelines-in-rancher/16005/1 "2019-12-04T09:51:41Z")

</div>

Hi,  
Every time I build an image through pipeline I want its tag to get updated automatically. For example if I give an image name as Image1:1.0 , the next time I run the pipeline, my new image should be Image:2.0. Is there any provision in Rancher for this?  
Thank you.

---

<div class="post-metadata">

**Author:** ![everton.andrade](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/everton.andrade/32/5875_2.png) [@everton.andrade](https://forums.suse.com/u/everton.andrade)\
**Post date:** [December 4, 2019, 8:29pm UTC](https://forums.suse.com/t/pipelines-in-rancher/16005/2 "2019-12-04T20:29:49Z")

</div>

Hello,

You can use the variables reference as explained at the end of the following page: [https://rancher.com/docs/rancher/v2.x/en/k8s-in-rancher/pipelines/](https://rancher.com/docs/rancher/v2.x/en/k8s-in-rancher/pipelines/)

So when you are building and publishing the image using the Rancher pipeline, you can include a tag like image:${CICD\_EXECUTION\_SEQUENCE}

---

<div class="post-metadata">

**Author:** ![nickl](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/nickl/32/4511_2.png) [@nickl](https://forums.suse.com/u/nickl)\
**Post date:** [December 10, 2019, 7:59pm UTC](https://forums.suse.com/t/pipelines-in-rancher/16005/3 "2019-12-10T19:59:42Z")

</div>

It looks like Rancher suggests using applyYamlConfig to update the image name. Is there a way to only update the image (or an example of how this yml file should look?)

---

<div class="post-metadata">

**Author:** ![everton.andrade](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/everton.andrade/32/5875_2.png) [@everton.andrade](https://forums.suse.com/u/everton.andrade)\
**Post date:** [December 13, 2019, 4:41pm UTC](https://forums.suse.com/t/pipelines-in-rancher/16005/4 "2019-12-13T16:41:09Z")

</div>

Hi @nickl,

Not sure about what you’re trying to do, but I think that the following procedure can help you somehow…

To guarantee that your pipeline always use the latest image when deploying the application, configure your pipeline to publish the image to dockerhub with a specific tag, like in the following image:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/b/b446ed3fbba35bd14230a28a8cdebae745ccdd29.png)

and when configuring your deployment include this same tag to your image:

```
spec:
  containers:
  - image: evertonaulian/node:${CICD_GIT_COMMIT}
    name: node
    ports:
    - containerPort: 3000
      name: node
```

---

<div class="post-metadata">

**Author:** ![nickl](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/nickl/32/4511_2.png) [@nickl](https://forums.suse.com/u/nickl)\
**Post date:** [December 25, 2019, 10:09pm UTC](https://forums.suse.com/t/pipelines-in-rancher/16005/5 "2019-12-25T22:09:53Z")

</div>

Got it, thanks!

And just to clarify - for the last step, I would need to include a ./deployment.yaml file in the repo with the full yaml file which I can grab from the Workload-\>View/Edit YAML? Or can it be a partial yaml file with just

```
spec:
  containers:
  - image: ourdocker/repo:${CICD_GIT_COMMIT}
```

---

<div class="post-metadata">

**Author:** ![everton.andrade](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/everton.andrade/32/5875_2.png) [@everton.andrade](https://forums.suse.com/u/everton.andrade)\
**Post date:** [December 31, 2019, 11:21am UTC](https://forums.suse.com/t/pipelines-in-rancher/16005/6 "2019-12-31T11:21:41Z")

</div>

Hi @nickl

You would need to include your full deployment.yaml file in the repo and include this file in your Pipeline configuration to be deployed in your environment as the following example:

 ![Screenshot 2019-12-11 09.50.18](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/7/73f1d8696d3e3f1fee13a878e6be7434f2f83f76.png)

---

<div class="post-metadata">

**Author:** ![nickl](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/nickl/32/4511_2.png) [@nickl](https://forums.suse.com/u/nickl)\
**Post date:** [January 2, 2020, 10:35pm UTC](https://forums.suse.com/t/pipelines-in-rancher/16005/7 "2020-01-02T22:35:55Z")

</div>

Got it, thanks for the response!
