These examples can apply to virtually any Jenkins deployment, provided that you already have some existing automated tests, have access to the Jenkins instance, and are either the maintainer or an admin of the target repository.
- Jenkins Server
- Sauce Labs Account
- The following permissions in Jenkins:
- ability to create and manage credentials
- ability to create and manage new pipelines
The first step of the integration is to ensure you've added your
SAUCE_ACCESS_KEY as a secret file/text in your Jenkins server (Not sure where to find these? They're here).
The easiest way to add credentials to Jenkins is with the UI:
Log in to Jenkins
Go to Manage Jenkins > Manage Credentials
Next to (Global), select Add credentials
For Kind, select Secret Text
Enter the following information:
- Scope: Global
- Secret: 'your-sauce-username'
- ID: 'sauce-username'
- Description: Sauce Labs Username
Repeat the above steps for your Sauce Labs Access Key
For further information on how to store your Sauce Labs credentials in Jenkins, visit the Jenkinsfile documentation.
Jenkinsfile at the root of your project directory so that Jenkins can detect changes and run
In the examples below, the
environment variables are the GitHub secrets configured in Jenkins:
You can view some of our public examples here.
Now you can commit these files and Jenkins will detect the new pipeline and launch
saucetl to run your tests.
For example if you're using the Blue Ocean plugin, your output may look something like this: