Files
harbormaster-server/.drone.yml
2025-02-23 20:25:08 -06:00

31 lines
914 B
YAML

kind: pipeline
type: docker
name: deploy-harbormaster
trigger:
event:
- custom
steps:
- name: build-and-push
image: docker:latest
environment:
REGISTRY: registry.binderlab.io:8000
IMAGE_NAME: registry.binderlab.io:8000/harbormaster
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
commands:
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin $REGISTRY
- docker build -t $IMAGE_NAME:latest .
- docker push $IMAGE_NAME:latest
- name: deploy
image: alpine
commands:
- echo "Deploying new version..."
- docker pull registry.binderlab.io/harbormaster:latest
- docker stop harbormaster || true
- docker rm harbormaster || true
- docker run -d --name harbormaster -p 8080:8080 registry.binderlab.io/harbormaster:latest