Skip to content

Commit 3024cb7

Browse files
author
Maurice Faber
committed
fix: drone policy [ci skip]
1 parent 2e2bca6 commit 3024cb7

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

bin/gen-drone.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,22 @@ function template_drone_config() {
2727
local target_path="$ENV_DIR/.drone.yml"
2828
local image_tag="$(otomi_image_tag)"
2929
local cluster="$(yqr cluster.name)"
30+
local pullPolicy="always"
31+
[ "${image_tag:0:1}" = "v" ] && pullPolicy='if-not-exists'
3032

3133
printf "${COLOR_LIGHT_PURPLE}Creating $target_path ${COLOR_NC}\n"
3234

3335
local target=$target_path
3436
[ "${DRY_RUN-'false'}" = 'false' ] && target="/dev/stdout"
3537

3638
cat $template_path | sed \
37-
-e "s/__CLUSTER/${cluster}/g" \
38-
-e "s/__IMAGE_TAG/${image_tag}/g" \
39-
-e "s|__WEBHOOK|${webhook}|g" \
40-
-e "s/__CUSTOMER/${customer_name}/g" \
41-
-e "s/__BRANCH/${branch}/g" \
42-
-e "s/__CHANNEL/${channel}/g" \
39+
-e "s/__CLUSTER/$cluster/g" \
40+
-e "s/__IMAGE_TAG/$image_tag/g" \
41+
-e "s|__WEBHOOK|$webhook|g" \
42+
-e "s/__CUSTOMER/$customer_name/g" \
43+
-e "s/__BRANCH/$branch/g" \
44+
-e "s/__CHANNEL/$channel/g" \
45+
-e "s/__PULL_POLICY/$pullPolicy/g" \
4346
>$target
4447
}
4548

tpl/.drone.tpl.msteams.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ steps:
3434

3535
- name: test
3636
image: otomi/core:__IMAGE_TAG
37-
pull: always
37+
pull: __PULL_POLICY
3838
depends_on:
3939
- prepare-env
4040
commands:
4141
- cd .. && bin/otomi test
4242

4343
- name: apply
4444
image: otomi/core:__IMAGE_TAG
45-
pull: always
45+
pull: __PULL_POLICY
4646
commands:
4747
- cd .. && bin/otomi apply
4848
depends_on:

tpl/.drone.tpl.slack.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ steps:
3636

3737
- name: test
3838
image: otomi/core:__IMAGE_TAG
39-
pull: always
39+
pull: __PULL_POLICY
4040
depends_on:
4141
- prepare-env
4242
commands:
4343
- cd .. && bin/otomi test
4444

4545
- name: apply
4646
image: otomi/core:__IMAGE_TAG
47-
pull: always
47+
pull: __PULL_POLICY
4848
commands:
4949
- cd .. && bin/otomi apply
5050
depends_on:

0 commit comments

Comments
 (0)