Environments are deployment targets

CI variables can be scoped to environments

Your demo environment has hidden services

WebDAV endpoints emulate deployment targets

Hands-On (1/2)

  1. Optionally, create environments dev and live
  2. Retrieve passwords for dev and live environments:

     docker ps --filter "label=com.docker.compose.service=nginx" --quiet \
     | xargs -I{} docker logs {} | grep "Password for "

  3. Create unprotected CI variable PASS twice with scope dev/live
  4. Create unprotected CI variable SEAT_INDEX with your seat number
  5. Add new stage and job called deploy
  6. Upload to WebDAV server dev using curl
  7. Download from https://dev.seatN.inmylab.de/hello
  8. Check environments

(See new demo1/gitlab-ci.yml)

Pro tip

Branches can be used to represent target environments:

Hands-On (2/2)

  1. Create branch called dev
  2. Use environment ${CI_COMMIT_REF_NAME}
  3. Commit and check pipeline
  4. Create branch live from dev
  5. Download from https://dev.seatN.inmylab.de/hello and live equivalent

(See new demo2/.gitlab-ci.yml)