Skip to main content

Working With Semaphore CI

Configuring the Applitools CI/CD Integration

  1. On the Project page, click Project Settings.

  2. 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)
  3. Click on Environment Variables and click Add.

  4. In the Name field, enter APPLITOOLS_API_KEY.

  5. 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.

  6. Select the Encrypt Content check box.

  7. 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.

note

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.