selfprivacy-nixos-infect

Drone configuration

SecretValue
CHANNEL_SWITCHER_KEYBearer token for Channel Rest Api of selfprivacy.org
CLOUDFLARE_TOKENBearer token for Cloudflare to communicate with DNS entires
DOMAINFull domain that points out to our testing server
HETZNER_TOKENBearer token for Hetzner to request server creation and destruction
TEST_EMAIL_PASS???
USER_PASS???
ZONE_IDIdentificator of a zone to which all our DNS entries are related
Cronjob TitleBranchCronjob Value
weekly-builddevelopment@weeklyOur main job we run every week to ensure the upstream of our application is able to deploy onto a clean server completely. We'd like to build everyday, but for now we need to solve acme problem, since it rejects our requests if we do it every 24 hours...

Drone pipeline

Stage Default:

Step
cloneCheckout the HEAD commit
deployCreate infect.sh script and send it with a POST request to the clean server to deploy our testing environment
dnsCreate DNS entries for subdomains to ensure networking and certificates for properly
sleepWait for the environment to build (it takes a while...)
testRequest for overall status, do basic checks on the server
teardownDestroy the environment and all DNS entries, tests are over!
switch-channelUpdate upstream NixOS channel at selfprivacy.org

It is ensured that teardown step must happen whether the pipeline fails or succeeds, because we need the server to be clean before every new job. It is done by forcing the step to be called with status trigger:

- name: teardown
  . . . 
  when:
    status:
    - failure
    - success