always build the latest tag

This commit is contained in:
Oliver Gorwits
2018-01-12 19:41:52 +00:00
parent 32756baec2
commit 7161ec41ee
4 changed files with 5 additions and 13 deletions

2
.gitignore vendored
View File

@@ -11,6 +11,6 @@ MANIFEST.*
*.komodo*
Makefile*
Build
!docker/hooks/*
_build
blib
docker/netdisco

View File

@@ -4,8 +4,6 @@ services:
image: netdisco-postgresql:latest
build:
context: netdisco-postgresql
args:
- TAG
volumes:
- "./netdisco/pgdata:/var/lib/postgresql/data"
# netdisco-base:

View File

@@ -1,20 +1,16 @@
# vim: ft=Dockerfile
FROM docker.io/postgres:9.6.6-alpine
ARG TAG
ENV TAG ${TAG:-master}
RUN apk add --no-cache \
curl \
jq \
tar
WORKDIR /var/lib/postgresql/netdisco-sql
RUN curl -sL "https://api.github.com/repos/netdisco/netdisco/tarball/${TAG}" | \
tar --wildcards -zt '*App-Netdisco-DB-*' | xargs -n1 basename | sort -n -t '-' -k4 | \
while read file; \
do curl -sLO "https://raw.githubusercontent.com/netdisco/netdisco/${TAG}/share/schema_versions/$file"; \
done && \
RUN curl -s https://api.github.com/repos/netdisco/netdisco/tags | \
jq '.[]|.name|select(test("^\\d+\\.\\d+$"))|"https://api.github.com/repos/netdisco/netdisco/tarball/"+.' | \
sort -rg | head -n1 | xargs -n1 curl -sL | \
tar --wildcards --strip-components=3 -zx '*App-Netdisco-DB-*' && \
curl -sLO "https://raw.githubusercontent.com/netdisco/upstream-sources/master/ieee/oui.sql" && \
curl -sLO "https://raw.githubusercontent.com/netdisco/netdisco/master/lib/App/Netdisco/DB.pm"

View File

@@ -1,2 +0,0 @@
#!/bin/bash
docker build --build-arg TAG=$SOURCE_BRANCH -t $IMAGE_NAME .