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* *.komodo*
Makefile* Makefile*
Build Build
!docker/hooks/*
_build _build
blib blib
docker/netdisco

View File

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

View File

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