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