kind: pipeline type: docker name: deploy-harbormaster trigger: event: - custom steps: # - name: build-and-push # image: plugins/docker # settings: # username: # from_secret: DOCKER_USERNAME # password: # from_secret: DOCKER_PASSWORD # repo: registry.binderlab.io/harbormaster # registry: registry.binderlab.io # tags: latest - name: deploy image: plugins/docker privileged: true environment: DOCKER_USERNAME: from_secret: DOCKER_USERNAME DOCKER_PASSWORD: from_secret: DOCKER_PASSWORD commands: - echo "Deploying new version..." - echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin registry.binderlab.io - 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