From 06ae4fe0781da684c1c7fb59b3d45b487abab86e Mon Sep 17 00:00:00 2001 From: Max Regan Date: Sun, 3 May 2020 04:04:18 +0000 Subject: [PATCH] Move to Gitlab CI --- .drone.yml | 11 ----------- .gitlab-ci.yml | 30 ++++++++++++++++++++++++++++++ Dockerfile | 2 +- Jenkinsfile | 8 -------- README.md | 2 -- 5 files changed, 31 insertions(+), 22 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitlab-ci.yml delete mode 100644 Jenkinsfile diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 854c093..0000000 --- a/.drone.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -kind: pipeline -name: default - -steps: -- name: kaniko - image: banzaicloud/drone-kaniko - settings: - registry: registry.lan - repo: drone-test - auto_tag: true \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..3f82135 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,30 @@ +stages: + - build + - release + +variables: + CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest + +build: + image: docker:19.03.8 + services: + - docker:19.03.8-dind + stage: build + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker build --pull -t $CONTAINER_TEST_IMAGE . + - docker push $CONTAINER_TEST_IMAGE + +release: + image: docker:19.03.8 + services: + - docker:19.03.8-dind + stage: release + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker pull $CONTAINER_TEST_IMAGE + - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE + - docker push $CONTAINER_RELEASE_IMAGE + only: + - master diff --git a/Dockerfile b/Dockerfile index e1f35c2..81647e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.lan/alpine:3.10 +FROM alpine:3 RUN apk -v --update add \ bash \ diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index d267982..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,8 +0,0 @@ -node { - checkout scm - docker.withRegistry('https://registry.lan') { - def image = docker.build('dns-updater') - image.push("1") - image.push("latest") - } -} \ No newline at end of file diff --git a/README.md b/README.md index e7cc582..0bbd6e5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Homelab-Route53-DNS -[![Build Status](https://drone.lan/api/badges/max/Homelab-Route53-DNS/status.svg)](https://drone.lan/max/Homelab-Route53-DNS) - home.maxregan.me is a record that points to my home router for VPN access. Since IP is dynamic, this package builds a Docker image which automatically updates the DNS record stored in [AWS Route53](https://aws.amazon.com/route53/). The built docker image executes a cronjob that queries http://checkip.amazonaws.com/ to discover its external IP, and then updates the record for home.maxregan.me accordingly. AWS credentials are passed as environment variables. \ No newline at end of file