StorminStanley / st2workroom

Vagrant environment used to play with StackStorm, develop StackStorm for your environment, or develop on StackStorm itself!
Apache License 2.0
23 stars 21 forks source link

Fix "-r" option #322

Closed Kami closed 8 years ago

Kami commented 8 years ago

Now if "-r" option is specified we also set ENV environment variable to current_working_directory so the checked out changes (revision) are actually used.

P.S. As noted on Slack, this is a very simple solution I could come up with first which works (that's basically how I / we have been testing changes manually before this option).

Resolves #321.

Tested with:

curl -o install.sh https://raw.githubusercontent.com/StackStorm/st2workroom/ce8dbb424bfbe58224fde44217eb0dd4ade1aa25/script/bootstrap-st2 # we want to use bootstrap-st2 from this branch of course which includes the fix
DEBUG=1 bash install.sh -r test_rev_branch # created a test branch which introduces a failure
...
1901_remove_hubot_dependencies_from_answers] will propagate my refresh event
Debug: Exec[test-fail](provider=posix): Executing 'echo "fail" ; exit 1'
Debug: Executing: 'echo "fail" ; exit 1'
Notice: /Stage[main]/Profile::St2server/Exec[test-fail]/returns: fail
Error: echo "fail" ; exit 1 returned 1 instead of one of [0]
Error: /Stage[main]/Profile::St2server/Exec[test-fail]/returns: change from notrun to 0 failed: echo "fail" ; exit 1 returned 1 instead of one of [0]
Notice: /Stage[main]/Profile::St2server/File[/var/sockets]/ensure: created
....
manasdk commented 8 years ago

:+1:

Kami commented 8 years ago

Would also be a good idea to add a test case for that.

Maybe we can push a dummy branch which always fails early on and we add a new st2cd test case which uses "-r ".

In any case, not something I will do today, but if someone else has motivation and time to do it today, feel free to do so.

Kami commented 8 years ago

Alright, I will merge this and work on tests tomorrow.

Kami commented 8 years ago

Also confirmed it's working now on master.

curl -L -o install.sh https://install.stackstorm.com
DEBUG=1 bash install.sh -r test_rev_branch