Integrating Runscope with Codeship
At Codeship, we’re pleased to be able to integrate with several third-party products across a variety of areas to ensure your CI/CD workflows are that much smoother. For example, Runscope is an API testing and monitoring tool that can be used with continuous integration and delivery services like Codeship to test and validate your web applications.
By using Runscope, you can ship more reliable code for your teams and your customers.
The Runscope documentation provides a great guide to getting started, and the instructions below have more information on integrating with Codeship Pro and Basic.
Codeship Pro
To run your Runscope API tests on Codeship, you will need to add your Runscope Access Token to your encrypted environment variables that you encrypt and include in your codeship-services.yml file.
You can get your access token from your Runscope settings.
Installing Runscope dependencies and script
After setting your personal access token, you will need to build a service in your codeship-services.yml file with the Runscope dependencies installed.
Runscope distributes these dependencies through pip, so you will need to be sure your service also has Python and Pip installed.
To install the dependencies you need, you can add the following to your Service’s Dockerfile:
RUN pip install -r https://raw.githubusercontent.com/Runscope/python-trigger-sample/master/requirements.txt
Once you have the dependencies installed, you can add another line to your Service’s Dockerfile to install the Runscope script itself:
RUN wget https://raw.githubusercontent.com/Runscope/python-trigger-sample/master/app.py
Note again that your service must be able to use wget for the above command to execute.
Triggering Runscope during a build
To run the Runscope script and execute your tests during your build, you can use the Runscope script you installed via your codeship-services.yml file in a step called via your codeship-steps.yml file:
- name: Runscope service: app command: runscope.sh
Inside of the runscope.sh
file, you can call the Runscope script with the following command:
python app.py https://api.runscope.com/radar/your_test_trigger_id/trigger?runscope_environment=your_runscope_environment_id
Note that you will need to change the URL to reflect the actual Trigger URL you have configured in Runscope.
Codeship Basic
To run your Runscope API tests on Codeship, you will need to add your Runscope Access Token to your Codeship project’s environment variables.
You can get your access token from your Runscope settings.
Installing Runscope dependencies and script
After setting your personal access token, you will need to install the Runscope dependencies and the Runscope script in your project’s setup commands.
In your setup commands, add the following:
pip install -r https://raw.githubusercontent.com/Runscope/python-trigger-sample/master/requirements.txt
and
wget https://raw.githubusercontent.com/Runscope/python-trigger-sample/master/app.py
Triggering Runscope during a build
To run the Runscope script and execute your tests during your build, you can use the Runscope script you installed in your setup commands by calling the script in your project’s test or deployment commands.
Inside of your test or deployment commands, simply add the following:
python app.py https://api.runscope.com/radar/your_test_trigger_id/trigger?runscope_environment=your_runscope_environment_id
Note that you will need to change the URL to reflect the actual Trigger URL you have configured in Runscope.
Stay up to date
We'll never share your email address and you can opt out at any time, we promise.