Skip to content

GitLab CI

Go to Settings > CI/CD > Variables and add:

  • Key: PAKYAS_API_KEY
  • Value: pk_live_...
  • Type: Variable
  • Flags: Masked (Recommended), Protected (if used on protected branches)
stages:
- build
nightly-job:
stage: build
script:
# Install Pakyas (or use a docker image that has it)
- curl -fsSL https://pakyas.com/install.sh | bash
# Wrap your command
- pakyas monitor nightly-build -- ./run_tests.sh
only:
- schedules

To ensure pings are sent even if the script crashes, you can use after_script, but keep in mind after_script runs in a separate shell context, so local variables won’t persist.

nightly-job:
script:
- pakyas ping nightly-build --start
- ./hazardous-script.sh
only:
- schedules
after_script:
- |
if [ "$CI_JOB_STATUS" == "success" ]; then
pakyas ping nightly-build
else
pakyas ping nightly-build --fail
fi