Working With Semaphore CI
Configuring the Applitools CI/CD Integration
-
On the Project page, click Project Settings.
-
In the setup panel, click Add New Command Line, then copy the following line to the field and press enter:
export APPLITOOLS_BATCH_ID=$(echo $REVISION) -
Click on Environment Variables and click Add.
-
In the Name field, enter
APPLITOOLS_API_KEY. -
In the Content field, enter the value of your API key. To obtain the value of your API key, see How to obtain your API key.
-
Select the Encrypt Content check box.
-
Click Create Variable.
Enabling Applitools logs in Semaphore CI
To capture Applitools SDK logs in Semaphore, set the log environment variables in your build and keep the log folder as an artifact or workspace directory:
export APPLITOOLS_SHOW_LOGS=true
export APPLITOOLS_LOG_DIR=logs
Then publish the logs/ folder as a build artifact or persist it to the workspace so it can be inspected after the build.
If your Semaphore job runs inside Docker, the log files are written inside the container and may be lost when the container stops. Mount the container log directory to the workspace path.
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 the workspace path used by your Semaphore runner.