saucectl with CircleCI
These examples can apply to virtually any CircleCI deployment, provided that you already have some existing automated tests, and are either the maintainer or an admin of the target repository.
What You'll Need
- A Sauce Labs account (Log in or sign up for a free trial license)
- Your Sauce Labs Username and Access Key
- A CircleCI Account
- A git repository hosting service (GitHub or BitBucket)
The first step is to ensure you have a CircleCI account, and to login with your git hosting provider username; the examples below use GitHub authentication.
- Log in to CircleCI.
- Choose the desired repo and click Set Up Project.
- Select Add Config (or Use Existing Config). This creates a new branch in your project called
Do not worry if your project fails to build. You'll need to modify the
config.yml manually anyway.
Add Project Environment Variables
In order for CircleCI to communicate with Sauce Labs you need to authenticate with project environment variables.
In CircleCI, go to your Project Settings.
Select Environment Variables.
Add variables for your Sauce Labs account credentials as
Modify the CircleCI Configuration
In the root of your project directory, create the
.circlecidirectory if it doesn't already exist, and open/create
You can easily execute saucectl on CircleCI through saucectl-run orb. Add the orb to your current
config.ymlusing the following reference to use it:
- Now you can use the orb directly as a step of one of your jobs:
You can reference a complete
config.yml example for more detail.
- Commit the updated
config.ymlto your git hosting service provider.
- Navigate back to the CircleCI dashboard to see your build pass.