Draft: [CI/CD] Build docker container and deploy to kube#1
Draft: [CI/CD] Build docker container and deploy to kube#1zinstack625 wants to merge 5 commits intoFe-Ti:masterfrom
Conversation
Maybe it's better to use a CI variable/secret as a container name? |
Fe-Ti
left a comment
There was a problem hiding this comment.
Except for my concerns about using variables, everything looks nice
| build: | ||
| uses: ./.github/workflows/build-image.yml | ||
| with: | ||
| image_name: zinstack625/iscraweb-ttbot |
There was a problem hiding this comment.
E.g. here could be something like
image_name: ${{ secrets.DOCKERHUB_USERNAME }}/${{ vars.CONTAINER_NAME }}| command: | | ||
| echo -n "$KUBECONFIG_FILE" > .kubeconfig | ||
| export KUBECONFIG=$(pwd)/.kubeconfig | ||
| kubectl rollout restart -n iscrawebtt deployment ttbot-bleed |
There was a problem hiding this comment.
Same goes for line 26:
kubectl rollout restart -n $NAMESPACE $RESOURCE_TYPE $RESOURCE| @@ -0,0 +1,12 @@ | |||
| #!/usr/bin/env sh | |||
|
|
|||
| [ -z "$CONTAINER_NAME" ] && CONTAINER_NAME=docker.io/Fe-Ti/iscraweb-ttbot:latest | |||
There was a problem hiding this comment.
Maybe it's better to stop execution with error instead of hardcoding a link*:
die() {
echo "$1"; exit 1
}
[ -z "$CONTAINER_NAME" ] && die 'CONTAINER_NAME is not set! Set envvar $CONTAINER_NAME'- Fun note: I've tried to create account with dash, but docker hub said that it's prohibited :-)
|
I've made some changes to underlying library, so parameter Also with recent changes¹ there is new command called ¹ Now bot uses http and json if started with {
"commands" : ["cmd",...] | "cmd"
} |
| { | ||
| "refresh_period" : $REFRESH_PERIOD, | ||
| "sleep_timeout" : $SLEEP_TIMEOUT, | ||
| "notify_period" : $NOTIFY_PERIOD, |
There was a problem hiding this comment.
This line (4) should be removed if we're going to rely on cron (I suppose it's better).
Or it should look like this (if we rely on internal implementation):
"notify_schedule" : ["09:00", "21:00"],
This needs 3 secrets:
DOCKERHUB_USERNAMEDOCKERHUB_TOKENKUBECONFIGBefore being ready for merge, container name needs changing. I don't know how it will be called, so this is blocked for now