diff --git a/.drone.star b/.drone.star index 0248d81..9c91eb7 100644 --- a/.drone.star +++ b/.drone.star @@ -71,26 +71,42 @@ def main(ctx): "output": "{coder_template}/main.tf".format(coder_template = coder_template), }, }, + # { + # "name": "push {coder_template}".format(coder_template = coder_template), + # "image": "alpine:latest", + # "environment": { + # "CODER_URL": "http://coder.coder.svc.cluster.local", + # "CODER_SESSION_TOKEN": { + # "from_secret": "CODER_SESSION_TOKEN", + # }, + # "CODER_TEMPLATE_VERSION": ctx.build.commit, + # }, + # "commands": [ + # "apk add git", + # "wget -q -O- {url} | tar -xzf - -C /usr/local/bin ./coder".format(url = CODER_URL), + # "sleep $(( $RANDOM % 15 ))", + # " || ".join([ + # "coder templates push -d {name} --yes {name}".format(name = coder_template), + # "coder templates create -d {name} --yes {name}".format(name = coder_template), + # ]), + # ], + # "depends_on": [ + # "generate {coder_template}".format(coder_template = coder_template), + # ], + # }, { "name": "push {coder_template}".format(coder_template = coder_template), - "image": "alpine:latest", + "image": "cr.smcm.xyz/drone-plugins/coder", "environment": { - "CODER_URL": "http://coder.coder.svc.cluster.local", - "CODER_SESSION_TOKEN": { + }, + "settings": { + "template": coder_template, + "coder_url": "http://coder.coder.svc.cluster.local", + "coder_session_token": { "from_secret": "CODER_SESSION_TOKEN", }, - "CODER_TEMPLATE_VERSION": ctx.build.commit, + "coder_template_version": ctx.build.commit, }, - "commands": [ - "apk add git", - "wget -q -O- {url} | tar -xzf - -C /usr/local/bin ./coder".format(url = CODER_URL), - "cat {name}/main.tf".format(name = coder_template), - "sleep $(( $RANDOM % 15 ))", - " || ".join([ - "coder templates push -d {name} --yes {name}".format(name = coder_template), - "coder templates create -d {name} --yes {name}".format(name = coder_template), - ]), - ], "depends_on": [ "generate {coder_template}".format(coder_template = coder_template), ],