Compare commits

..

No commits in common. "ee4720e7fa77be6818802cfd036d56c3a7808e7d" and "534927e112b591b22488ce6d01948ec4529e7bb2" have entirely different histories.

2 changed files with 32 additions and 33 deletions

View File

@ -18,11 +18,11 @@ TEMPLATES = {
"splunk-82": {"image": "cr.smcm.xyz/coder-images/splunk-8.2:latest"},
"splunk-90": {"image": "cr.smcm.xyz/coder-images/splunk-9.0:latest"},
},
# "proxychains": {
# "splunk-python": {"image": "cr.smcm.xyz/coder-images/python-38:latest"},
# },
"proxychains": {
"splunk-python": {"image": "cr.smcm.xyz/coder-images/python-38:latest"},
},
"jupyter": {
"jupyter-scipy-notebook": {"image": "cr.smcm.xyz/coder-images/jupyter-scipy-notebook:latest"},
"jupyter": {"image": "cr.smcm.xyz/coder-images/jupyter-scipy-notebook:latest"},
},
}
@ -36,14 +36,11 @@ def get_jinja_command(template, output, context):
)
def main(ctx):
pipeline = {
"kind": "pipeline",
"name": "default",
"type": "docker",
"steps": [],
}
jinja_commands = []
coder_commands = [
"apk add git",
"wget -q -O- {url} | tar -xzf - -C /usr/local/bin ./coder".format(url = CODER_URL),
]
for jinja_template in TEMPLATES:
for coder_template in TEMPLATES[jinja_template]:
@ -54,8 +51,25 @@ def main(ctx):
TEMPLATES[jinja_template][coder_template],
))
pipeline["steps"].append({
"name": "push {name}".format(name = coder_template),
coder_commands.append(
" || ".join([
"coder templates push -d {name} --yes {name}".format(name = coder_template),
"coder templates create -d {name} --yes {name}".format(name = coder_template),
]),
)
return {
"kind": "pipeline",
"name": "default",
"type": "docker",
"steps": [
{
"name": "generate templates",
"image": "roquie/docker-jinja2-cli",
"commands": jinja_commands,
},
{
"name": "push templates",
"image": "alpine:latest",
"environment": {
"CODER_URL": "http://coder.coder.svc.cluster.local",
@ -64,21 +78,7 @@ def main(ctx):
},
"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),
" || ".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 templates",
],
})
pipeline["steps"].insert(0, {
"name": "generate templates",
"image": "roquie/docker-jinja2-cli",
"commands": jinja_commands,
})
"commands": coder_commands,
},
],
}

View File

@ -10,7 +10,7 @@ resource "coder_app" "jupyter" {
share = "public"
healthcheck {
url = "http://localhost:8888/api"
url = "http://localhost:8888/lab"
interval = 3
threshold = 10
}
@ -30,5 +30,4 @@ resource "coder_app" "jupyter" {
{% endblock %}
{% block post_startup_script_setup_home %}
/usr/local/bin/start-notebook.sh | tee jupyter-startup.log &
{% endblock %}