From 901fda0e3e0d76020724b3a7f83dd9b060a5416d Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Wed, 13 Mar 2019 00:07:35 -0700 Subject: [PATCH] Update coreos/dnsmasq image and automate deploys * Update base image from alpine:3.6 to alpine:3.9 * Automatically publish dnsmasq image on merge to a branch named "dnsmasq". Similar to how matchbox is automatically published from master. Set the version based on git SHA --- .travis.yml | 19 +++++++++++++------ contrib/dnsmasq/Dockerfile | 4 ++-- contrib/dnsmasq/Makefile | 5 +++-- contrib/dnsmasq/travis-deploy | 11 +++++++++++ 4 files changed, 29 insertions(+), 10 deletions(-) create mode 100755 contrib/dnsmasq/travis-deploy diff --git a/.travis.yml b/.travis.yml index 4f23d04d..bd8675fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,18 @@ install: script: - make deploy: - provider: script - script: scripts/dev/travis-docker-push - skip_cleanup: true - on: - branch: master - go: '1.11.7' + - provider: script + script: scripts/dev/travis-docker-push + skip_cleanup: true + on: + branch: master + go: '1.11.7' + - provider: script + script: contrib/dnsmasq/travis-deploy + skip_cleanup: true + on: + branch: dnsmasq + # pick one, so travis deploys once + go: '1.10.x' notifications: email: change diff --git a/contrib/dnsmasq/Dockerfile b/contrib/dnsmasq/Dockerfile index fb2d74e7..44241c79 100644 --- a/contrib/dnsmasq/Dockerfile +++ b/contrib/dnsmasq/Dockerfile @@ -1,5 +1,5 @@ -FROM alpine:3.6 -MAINTAINER Dalton Hubble +FROM alpine:3.9 +LABEL maintainer="Dalton Hubble " RUN apk -U add dnsmasq curl COPY tftpboot /var/lib/tftpboot EXPOSE 53 67 69 diff --git a/contrib/dnsmasq/Makefile b/contrib/dnsmasq/Makefile index f74da5e2..ba0a8115 100644 --- a/contrib/dnsmasq/Makefile +++ b/contrib/dnsmasq/Makefile @@ -1,4 +1,5 @@ -VERSION=v0.5.0 +DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) +VERSION=$(shell git describe --tags --match=v* --always --dirty) IMAGE_REPO=coreos/dnsmasq QUAY_REPO=quay.io/coreos/dnsmasq @@ -8,7 +9,7 @@ all: docker-image .PHONY: tftp tftp: - @./get-tftp-files + @$(DIR)/get-tftp-files .PHONY: docker-image docker-image: tftp diff --git a/contrib/dnsmasq/travis-deploy b/contrib/dnsmasq/travis-deploy new file mode 100755 index 00000000..0ca8726d --- /dev/null +++ b/contrib/dnsmasq/travis-deploy @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e + +# dirty hack +cd "$(dirname $0)" + +docker info +make docker-image +docker login -u="$DOCKER_USERNAME" -p=$DOCKER_PASSWORD quay.io +make docker-push +