Tagging in after_success script doesn't trigger deployment

Build: 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
However, that has the same results.

Here’s the script that it executes: https://github.com/popatop15/TimeMine/blob/master/script.sh
And my .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 :slight_smile:

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.

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.

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

1 Like

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

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

A post was split to a new topic: Another build is triggered if I create a tag dynamically