Compare commits
No commits in common. "d8e0b79d98855c76f3179dbee8bfce9e013a741f" and "30c166e77ba02d2fbaf94d6fe49bb7ad14df17c9" have entirely different histories.
d8e0b79d98
...
30c166e77b
33
.drone.yml
33
.drone.yml
|
@ -3,7 +3,7 @@ type: docker
|
||||||
name: lint
|
name: lint
|
||||||
steps:
|
steps:
|
||||||
- name: lint
|
- name: lint
|
||||||
image: python:3-alpine
|
image: python:3-slim
|
||||||
commands:
|
commands:
|
||||||
- echo "Installing lint dependencies..."
|
- echo "Installing lint dependencies..."
|
||||||
- pip install --no-cache-dir .[lint] > /dev/null
|
- pip install --no-cache-dir .[lint] > /dev/null
|
||||||
|
@ -17,7 +17,7 @@ type: docker
|
||||||
name: test
|
name: test
|
||||||
steps:
|
steps:
|
||||||
- name: test
|
- name: test
|
||||||
image: python:3-alpine
|
image: python:3-slim
|
||||||
commands:
|
commands:
|
||||||
- echo "Installing test dependencies..."
|
- echo "Installing test dependencies..."
|
||||||
- pip install --no-cache-dir .[test] > /dev/null
|
- pip install --no-cache-dir .[test] > /dev/null
|
||||||
|
@ -32,7 +32,7 @@ depends_on:
|
||||||
- test
|
- test
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: python:3-alpine
|
image: python:3-slim
|
||||||
commands:
|
commands:
|
||||||
- pip install --no-cache-dir build
|
- pip install --no-cache-dir build
|
||||||
- python -m build --wheel
|
- python -m build --wheel
|
||||||
|
@ -43,8 +43,6 @@ steps:
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
event:
|
|
||||||
- push
|
|
||||||
settings:
|
settings:
|
||||||
username: jackhadrill
|
username: jackhadrill
|
||||||
password:
|
password:
|
||||||
|
@ -55,11 +53,6 @@ steps:
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: build-docker-amd64
|
name: build-docker-amd64
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- main
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- build-pypi
|
- build-pypi
|
||||||
platform:
|
platform:
|
||||||
|
@ -67,6 +60,9 @@ platform:
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
settings:
|
settings:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
repo: git.jacknet.io/jackhadrill/container-spawner
|
repo: git.jacknet.io/jackhadrill/container-spawner
|
||||||
|
@ -79,11 +75,6 @@ steps:
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: build-docker-arm64
|
name: build-docker-arm64
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- main
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- build-pypi
|
- build-pypi
|
||||||
platform:
|
platform:
|
||||||
|
@ -91,6 +82,9 @@ platform:
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
settings:
|
settings:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
repo: git.jacknet.io/jackhadrill/container-spawner
|
repo: git.jacknet.io/jackhadrill/container-spawner
|
||||||
|
@ -103,21 +97,14 @@ steps:
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: combine-manifests
|
name: combine-manifests
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- main
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- build-docker-amd64
|
- build-docker-amd64
|
||||||
- build-docker-arm64
|
- build-docker-arm64
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
steps:
|
steps:
|
||||||
- name: publish
|
- name: publish
|
||||||
image: plugins/manifest
|
image: plugins/manifest
|
||||||
settings:
|
settings:
|
||||||
username: jackhadrill
|
username: JackNet
|
||||||
password:
|
password:
|
||||||
from_secret: password
|
from_secret: password
|
||||||
target: git.jacknet.io/jackhadrill/container-spawner:latest
|
target: git.jacknet.io/jackhadrill/container-spawner:latest
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = containerspawner
|
name = containerspawner
|
||||||
version = 0.1.1
|
version = 0.1.0
|
||||||
|
|
|
@ -19,6 +19,6 @@ def default(path):
|
||||||
if not state.is_running(username):
|
if not state.is_running(username):
|
||||||
state.spawn(username)
|
state.spawn(username)
|
||||||
|
|
||||||
response = make_response(f"Container spawned. Reloading{'' if path else ' ' + path}...", 201)
|
response = make_response(f"Container spawned. Reloading `{path}`...", 201)
|
||||||
response.headers["Refresh"] = "2"
|
response.headers["Refresh"] = "5"
|
||||||
return response
|
return response
|
||||||
|
|
|
@ -44,15 +44,11 @@ class StateManager:
|
||||||
name=container_name,
|
name=container_name,
|
||||||
network=CONTAINER_NETWORK,
|
network=CONTAINER_NETWORK,
|
||||||
volumes={container_name: {"bind": CONTAINER_PERSIST}},
|
volumes={container_name: {"bind": CONTAINER_PERSIST}},
|
||||||
restart_policy={"Name": "always", "MaximumRetryCount": 5},
|
|
||||||
detach=True,
|
detach=True,
|
||||||
auto_remove=True
|
auto_remove=True
|
||||||
)
|
)
|
||||||
|
|
||||||
# Wait for container to start.
|
# Wait for container to start.
|
||||||
while container.status != "running":
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
# Disable auth.
|
# Disable auth.
|
||||||
|
@ -60,6 +56,3 @@ class StateManager:
|
||||||
|
|
||||||
# Install extensions.
|
# Install extensions.
|
||||||
container.exec_run("code-server --install-extension ms-python.python")
|
container.exec_run("code-server --install-extension ms-python.python")
|
||||||
|
|
||||||
# Restart container.
|
|
||||||
container.restart()
|
|
||||||
|
|
Loading…
Reference in New Issue