# Tagging in after\_success script doesn't trigger deployment

**URL:** <https://travis-ci.community/t/tagging-in-after-success-script-doesnt-trigger-deployment/6540>\
**Category:** Deployment\
**Created:** [December 18, 2019, 6:47pm UTC](https://travis-ci.community/t/tagging-in-after-success-script-doesnt-trigger-deployment/6540 "2019-12-18T18:47:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![popatop15](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@popatop15](https://travis-ci.community/u/popatop15)\
**Post date:** [December 18, 2019, 6:47pm UTC](https://travis-ci.community/t/tagging-in-after-success-script-doesnt-trigger-deployment/6540/1 "2019-12-18T18:47:34Z")

</div>

Build: [https://travis-ci.com/popatop15/TimeMine/builds/141644846](https://travis-ci.com/popatop15/TimeMine/builds/141644846)

I have tried tagging in before\_deploy like stated in the docs here: [https://docs.travis-ci.com/user/deployment/releases/#setting-the-tag-at-deployment-time](https://docs.travis-ci.com/user/deployment/releases/#setting-the-tag-at-deployment-time)  
However, that has the same results.

Here’s the script that it executes: [https://github.com/popatop15/TimeMine/blob/master/script.sh](https://github.com/popatop15/TimeMine/blob/master/script.sh)  
And my .travis.yml: [https://github.com/popatop15/TimeMine/blob/master/.travis.yml](https://github.com/popatop15/TimeMine/blob/master/.travis.yml)

I am 100% new to TravisCI, so forgive me if something seems odd or out of best practice. I’m just trying to set up a system which works 🙂

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [December 18, 2019, 7:14pm UTC](https://travis-ci.community/t/tagging-in-after-success-script-doesnt-trigger-deployment/6540/2 "2019-12-18T19:14:36Z")

</div>

`TRAVIS_TAG` envvar needs to be visible to the shell running the build logic – i.e. the main shell process. You are running `./script.sh` as a child process so its environment changes don’t propagate to the main shell.

`source ./script.sh` should fix the problem.

---

<div class="post-metadata">

**Author:** ![popatop15](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@popatop15](https://travis-ci.community/u/popatop15)\
**Post date:** [December 18, 2019, 7:18pm UTC](https://travis-ci.community/t/tagging-in-after-success-script-doesnt-trigger-deployment/6540/3 "2019-12-18T19:18:16Z")

</div>

Oh ok, I understand the problem you described, but where would I put that source option? Can’t seem to find it in the docs.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [December 18, 2019, 7:20pm UTC](https://travis-ci.community/t/tagging-in-after-success-script-doesnt-trigger-deployment/6540/4 "2019-12-18T19:20:00Z")

</div>

`source` (aka `.`) is a Bash builtin command ([https://linux.die.net/man/1/bash](https://linux.die.net/man/1/bash)).

---

<div class="post-metadata">

**Author:** ![popatop15](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@popatop15](https://travis-ci.community/u/popatop15)\
**Post date:** [December 18, 2019, 7:24pm UTC](https://travis-ci.community/t/tagging-in-after-success-script-doesnt-trigger-deployment/6540/5 "2019-12-18T19:24:58Z")

</div>

Thank you, wasn’t familiar with that command. Tested and this was my solution. Thanks!

---

<div class="post-metadata">

**Author:** ![popatop15](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@popatop15](https://travis-ci.community/u/popatop15)\
**Post date:** [December 18, 2019, 7:28pm UTC](https://travis-ci.community/t/tagging-in-after-success-script-doesnt-trigger-deployment/6540/6 "2019-12-18T19:28:56Z")

</div>

A quick note: `source` executes the contents of the file automatically so `./` or setting `+x` was not necessary.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [December 18, 2019, 7:41pm UTC](https://travis-ci.community/t/tagging-in-after-success-script-doesnt-trigger-deployment/6540/7 "2019-12-18T19:41:43Z")

</div>

Split this topic on December 18, 2019, 7:41pm UTC

A post was split to a new topic: [Another build is triggered if I create a tag dynamically](https://travis-ci.community/t/another-build-is-triggered-if-i-create-a-tag-dynamically/6541)
