Working With AppVeyor
Configuring the Applitools CI/CD Integration
-
In the
appveyor.ymlfile, add the following line in the init section:init:
-ps: $env: APPLITOOLS_BATCH_ID =
if ($env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT) {
$env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT
}
else {
$env: APPVEYOR_REPO_COMMIT
} -
On your project page, click SETTINGS.
-
On the left panel, select Environment, and in the Environment Variables section click Add Variable.
-
In the Name field, enter
APPLITOOLS_API_KEY. -
In the Value field, enter the value of your API key. To obtain the value of your API key, see How to obtain your API key.
-
Click Save.
Enabling Applitools logs in AppVeyor
To capture Applitools SDK logs during your AppVeyor build, set the log environment variables and publish the logs folder as an artifact:
environment:
APPLITOOLS_SHOW_LOGS: true
APPLITOOLS_LOG_DIR: logs
artifacts:
- path: logs
name: applitools-logs
If your AppVeyor build step runs inside Docker, the log files are written inside the container and can disappear when the container exits. Mount the container log directory to the host workspace so the files are preserved.
Example Docker command:
docker run \
-e APPLITOOLS_SHOW_LOGS=true \
-e APPLITOOLS_LOG_DIR=/usr/src/app/logs \
-v ${WORKSPACE}/applitools-logs:/usr/src/app/logs \
your-image-name
Adjust ${WORKSPACE} to your AppVeyor workspace path.