always build the latest tag
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -11,6 +11,6 @@ MANIFEST.*
|
|||||||
*.komodo*
|
*.komodo*
|
||||||
Makefile*
|
Makefile*
|
||||||
Build
|
Build
|
||||||
!docker/hooks/*
|
|
||||||
_build
|
_build
|
||||||
blib
|
blib
|
||||||
|
docker/netdisco
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
docker build --build-arg TAG=$SOURCE_BRANCH -t $IMAGE_NAME .
|
|
||||||
Reference in New Issue
Block a user