Move from gitlab-ci to drone
Signed-off-by: René Jochum <rene@jochum.dev>master 1.6.0-apache-r1
parent
03bd6a2f13
commit
eb487be25e
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- cron
|
||||||
|
- custom
|
||||||
|
- tag
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: registry.fk.jochum.dev
|
||||||
|
username: robot$mail+drone
|
||||||
|
password:
|
||||||
|
from_secret: registry.fk.jochum.dev-robot
|
||||||
|
repo: registry.fk.jochum.dev/mail/roundcube
|
||||||
|
auto_tag: true
|
@ -1,55 +0,0 @@
|
|||||||
image: docker:20.10.14
|
|
||||||
|
|
||||||
variables:
|
|
||||||
# When you use the dind service, you must instruct Docker to talk with
|
|
||||||
# the daemon started inside of the service. The daemon is available
|
|
||||||
# with a network connection instead of the default
|
|
||||||
# /var/run/docker.sock socket. Docker 19.03 does this automatically
|
|
||||||
# by setting the DOCKER_HOST in
|
|
||||||
# https://github.com/docker-library/docker/blob/d45051476babc297257df490d22cbd806f1b11e4/19.03/docker-entrypoint.sh#L23-L29
|
|
||||||
#
|
|
||||||
# The 'docker' hostname is the alias of the service container as described at
|
|
||||||
# https://docs.gitlab.com/ee/ci/services/#accessing-the-services.
|
|
||||||
#
|
|
||||||
# Specify to Docker where to create the certificates. Docker
|
|
||||||
# creates them automatically on boot, and creates
|
|
||||||
# `/certs/client` to share between the service and job
|
|
||||||
# container, thanks to volume mount from config.toml
|
|
||||||
DOCKER_TLS_CERTDIR: "/certs"
|
|
||||||
|
|
||||||
services:
|
|
||||||
- docker:20.10.14-dind
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- build
|
|
||||||
- push
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- echo -n $HARBOR_TOKEN | docker login -u "robot\$jochum+gitlab" --password-stdin $HARBOR_REGISTRY
|
|
||||||
- docker version
|
|
||||||
- docker info
|
|
||||||
|
|
||||||
after_script:
|
|
||||||
- docker logout $HARBOR_REGISTRY
|
|
||||||
|
|
||||||
Build:
|
|
||||||
stage: build
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
script:
|
|
||||||
- docker pull $HARBOR_REGISTRY_IMAGE:latest || true
|
|
||||||
- >
|
|
||||||
docker build
|
|
||||||
--pull
|
|
||||||
--cache-from $HARBOR_REGISTRY_IMAGE:latest
|
|
||||||
--tag $HARBOR_REGISTRY_IMAGE:$CI_COMMIT_SHA .
|
|
||||||
- docker push $HARBOR_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
|
||||||
|
|
||||||
Push_When_tag:
|
|
||||||
stage: push
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
script:
|
|
||||||
- docker pull $HARBOR_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
|
||||||
- docker tag $HARBOR_REGISTRY_IMAGE:$CI_COMMIT_SHA $HARBOR_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
|
||||||
- docker push $HARBOR_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
|
Loading…
Reference in New Issue