Open MihkelBaranov opened 3 years ago
Hi @MihkelBaranov. Thanks for the suggestion! We'll want to make sure we end up with a solution that works well with what the App Platform team has planned. In the meantime, it seems like this could be scripted. Something like this might work as part of a CD pipeline:
#!/bin/bash
set -e
if [ $# -ne 2 ]; then
echo -e "Usage:\n\n${0##*/} <APP ID> <TAG>"
exit 1
fi
APP_ID=$1
NEW_TAG=$2
TFILE=$(mktemp --suffix .yaml)
sed "s/{TAG_NAME}/${NEW_TAG}/g" app.yml > "${TFILE}"
doctl apps update "${APP_ID}" --spec "${TFILE}"
rm "${TFILE}"
@andrewsomething with your example are you assuming app.yml
is inside the project?
@jsmestad Yes, it assumes that it is run along side app.yml
. You can also retrieve the live spec with doctl. So something like:
doctl apps spec get "${APP_ID}" | sed "s/ tag: .*/ tag: ${NEW_TAG}/g" > "${TFILE}"
might work assuming there is only one service using an image. If there are more, you might need to use something like https://github.com/mikefarah/yq to dig into the yaml.
TIL about yq
🎉
What is the problem this feature would solve? Please describe.
Deployments from DO Container Registry to Apps platform are limited and require manual input which is not ideal. After contacting support i understand there are plans to support "deploy_on_push" for prebuilt images, but there's no ETA on that.
Describe the solution you'd like
Maybe it would be possible to include a new flag or some other way to specify the tag name when creating a new deployment using the cli.
Perhaps something like this
which would update the app.spec
before starting the deployment