Promote an Image Between Environments
/home/student/repos/storefront/envs/ holds one KEY=VALUE file per environment: dev.env, staging.env, production.env. A release moves the tested image forward with scripts/promote.sh FROM TO, run from the repository root.
Today it failed with sed: -e expression #1: unknown option to 's'. Earlier it set IMAGE_PULL_POLICY to an image name, and once it promoted a build that had never been verified.
Fix scripts/promote.sh FROM TO so that:
dev → staging and staging → production are allowed; anything else fails,FROM has VERIFIED=true,IMAGE= line of TO to the IMAGE of FROM, and VERIFIED=false in TO (the new image there still needs testing),TO stays exactly as it was, in the same order, comments included; FROM isn't changed,promoted <image> to <TO>.When it fails, no file may change.
About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Part of CI/CD Pipelines in Practice. Next step: Roll Back to the Right Release
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.