From 6619b4e1bd2146b53552ba7bff57224437e792d9 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Mon, 26 Apr 2021 08:33:19 +0200 Subject: [PATCH] fix: ci --- .drone.yml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++- Makefile | 4 +++- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5beaf32..3c3d9a8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,4 +11,69 @@ steps: event: - push - pull_request - - tag \ No newline at end of file + - tag + +- name: build-image-latest + image: docker.io/volkerraschek/build-image:latest + commands: + - make CONTAINER_RUNTIME=docker container-image/build + volumes: + - name: docker_socket + path: /var/run/docker.sock + when: + branch: + - master + +- name: push-image-latest + image: docker.io/volkerraschek/build-image:latest + commands: + - make CONTAINER_RUNTIME=docker container-image/push + environment: + CONTAINER_IMAGE_REGISTRY_PASSWORD: + from_secret: container_image_registry_password + volumes: + - name: docker_socket + path: /var/run/docker.sock + when: + repo: + - volker.raschek/dyndns-client + branch: + - master + +- name: push-latest-commit + environment: + GIT_PUSH_SSH_KEY: + from_secret: + github_ssh_key + image: appleboy/drone-git-push:0.2.0-linux-amd64 + settings: + remote: git@github.com:volker-raschek/dyndns-client.git + force: true + when: + repo: + - volker.raschek/dyndns-client + branch: + - master + event: + - push + +- name: notify + image: drillster/drone-email + environment: + PLUGIN_HOST: + from_secret: smtp_host + PLUGIN_USERNAME: + from_secret: smtp_username + PLUGIN_PASSWORD: + from_secret: smtp_password + PLUGIN_FROM: + from_secret: smtp_mail_address + when: + status: + - changed + - failure + +volumes: +- name: docker_socket + host: + path: /var/run/docker.sock \ No newline at end of file diff --git a/Makefile b/Makefile index 665b9fe..b22b7bd 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,8 @@ BASE_IMAGE_FULLY_QUALIFIED := ${BASE_IMAGE_REGISTRY_HOST}/${BASE_IMAGE_NAMESPAC # CONTAINER_IMAGE CONTAINER_IMAGE_REGISTRY_HOST := docker.io -CONTAINER_IMAGE_NAMESPACE := volkerraschek +CONTAINER_IMAGE_REGISTRY_USER := volkerraschek +CONTAINER_IMAGE_NAMESPACE := ${CONTAINER_IMAGE_REGISTRY_USER} CONTAINER_IMAGE_REPOSITORY := ${EXECUTABLE} CONTAINER_IMAGE_VERSION := latest CONTAINER_IMAGE_FULLY_QUALIFIED := ${CONTAINER_IMAGE_REGISTRY_HOST}/${CONTAINER_IMAGE_NAMESPACE}/${CONTAINER_IMAGE_REPOSITORY}:${CONTAINER_IMAGE_VERSION:v%=%} @@ -87,6 +88,7 @@ container-image/build: . container-image/push: container-image/build + ${CONTAINER_RUNTIME} login ${CONTAINER_IMAGE_REGISTRY_HOST} --username ${CONTAINER_IMAGE_REGISTRY_USER} --password ${CONTAINER_IMAGE_REGISTRY_PASSWORD} ${CONTAINER_RUNTIME} push ${CONTAINER_IMAGE_FULLY_QUALIFIED} # CONTAINER RUN - TEST