Forum

Welcome to the community! Register below to add topics and replies.

You need to log in to create posts and topics.

Set environment from URL

In order to set the environment directly from your CI server, we have now added the environment id as a URL parameter. 

The format is as follows:

http://staging-be.boozang.com/extension?token=xxxx&env=0#5ee2342740dbe86fff950c0a/master/m7/t1/run

You can now find the environment id on the Environment settings view:

 

 

 

 

Excellent!

Very useful feature, we can now have two parametrized jobs for the two main environments where we run our tests.

Great to hear!

As suggested, we will log the setting of environment when running the CI job so that you can see that it has been loaded successfully.

Hi,

I'd like to build a Jenkins job that takes two parameters: 1) the environment 2) the suite to run.

In Jenkins I shall do a concatenation with: static part (including token) + $env + $suite

http://eu.boozang.com/extension?token=xxxx&env=0#xxxx/master/mx/tx/run

What do you think? How can we easily create the proper url?

This is a great idea, and how I setup my job when not using tags.

I just created an example and it was a little trickier than I initially expected, but this should work.

Define what you need parameterized as String parameters. In my example I have

  • Env ($env)
  • Module id ($module_id)
  • Test id ($test_id)

See below screenshot how it looks in Jenkins

After that, I add my static variables for the job (I still separate them so I can easily duplicate this job for different projects). I have

  • BOOZANG_ENV="http://eu.boozang.com"
  • SECRET_TOKEN=c3f72763aec458ee8f4c79e6ac7517c65oo65b7579826d487652a2dd
  • PROJECT_ID=5ee65b7579826a487652a2bc
  • BRANCH=master

In the script part, I build the URL and run the job via Docker. This is what I did, but you can customize it to your liking

echo Running module id: $module_id and test id: $test_id on env: $env

echo Cleanup logs and report files

rm -rf *.out
rm -rf *.log
rm -rf *.json
rm -rf *.html
rm -rf *.png

echo Seeting job static variables

BOOZANG_ENV="http://eu.boozang.com"
SECRET_TOKEN=c3f72763aec4580d8f4c79e6ac7517c65ee65b7579826d487652d2dd
PROJECT_ID=5ee65b7579826a487652a2bc
BRANCH=master

echo Calculating full URL
URL="${BOOZANG_ENV}/extension?token=${SECRET_TOKEN}&env=${env}#${PROJECT_ID}/${BRANCH}/${module_id}/${test_id}/run"

echo URL=${URL}
nohup docker run --rm -v "$(pwd):/var/boozang/" styrman/boozang-runner ${URL}

Try it out and see if it works!

Create your account for free!

No credit card required.