Compare commits
No commits in common. "ee4720e7fa77be6818802cfd036d56c3a7808e7d" and "534927e112b591b22488ce6d01948ec4529e7bb2" have entirely different histories.
ee4720e7fa
...
534927e112
62
.drone.star
62
.drone.star
@ -18,11 +18,11 @@ TEMPLATES = {
|
|||||||
"splunk-82": {"image": "cr.smcm.xyz/coder-images/splunk-8.2:latest"},
|
"splunk-82": {"image": "cr.smcm.xyz/coder-images/splunk-8.2:latest"},
|
||||||
"splunk-90": {"image": "cr.smcm.xyz/coder-images/splunk-9.0:latest"},
|
"splunk-90": {"image": "cr.smcm.xyz/coder-images/splunk-9.0:latest"},
|
||||||
},
|
},
|
||||||
# "proxychains": {
|
"proxychains": {
|
||||||
# "splunk-python": {"image": "cr.smcm.xyz/coder-images/python-38:latest"},
|
"splunk-python": {"image": "cr.smcm.xyz/coder-images/python-38:latest"},
|
||||||
# },
|
},
|
||||||
"jupyter": {
|
"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):
|
def main(ctx):
|
||||||
pipeline = {
|
|
||||||
"kind": "pipeline",
|
|
||||||
"name": "default",
|
|
||||||
"type": "docker",
|
|
||||||
"steps": [],
|
|
||||||
}
|
|
||||||
|
|
||||||
jinja_commands = []
|
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 jinja_template in TEMPLATES:
|
||||||
for coder_template in TEMPLATES[jinja_template]:
|
for coder_template in TEMPLATES[jinja_template]:
|
||||||
@ -54,8 +51,25 @@ def main(ctx):
|
|||||||
TEMPLATES[jinja_template][coder_template],
|
TEMPLATES[jinja_template][coder_template],
|
||||||
))
|
))
|
||||||
|
|
||||||
pipeline["steps"].append({
|
coder_commands.append(
|
||||||
"name": "push {name}".format(name = coder_template),
|
" || ".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",
|
"image": "alpine:latest",
|
||||||
"environment": {
|
"environment": {
|
||||||
"CODER_URL": "http://coder.coder.svc.cluster.local",
|
"CODER_URL": "http://coder.coder.svc.cluster.local",
|
||||||
@ -64,21 +78,7 @@ def main(ctx):
|
|||||||
},
|
},
|
||||||
"CODER_TEMPLATE_VERSION": ctx.build.commit,
|
"CODER_TEMPLATE_VERSION": ctx.build.commit,
|
||||||
},
|
},
|
||||||
"commands": [
|
"commands": coder_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,
|
|
||||||
})
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ resource "coder_app" "jupyter" {
|
|||||||
share = "public"
|
share = "public"
|
||||||
|
|
||||||
healthcheck {
|
healthcheck {
|
||||||
url = "http://localhost:8888/api"
|
url = "http://localhost:8888/lab"
|
||||||
interval = 3
|
interval = 3
|
||||||
threshold = 10
|
threshold = 10
|
||||||
}
|
}
|
||||||
@ -30,5 +30,4 @@ resource "coder_app" "jupyter" {
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block post_startup_script_setup_home %}
|
{% block post_startup_script_setup_home %}
|
||||||
/usr/local/bin/start-notebook.sh | tee jupyter-startup.log &
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user