Compare commits
No commits in common. "master" and "v0.1.0" have entirely different histories.
3 changed files with 15 additions and 40 deletions
|
@ -1,6 +1,6 @@
|
||||||
FROM nginx:alpine-perl
|
FROM nginx:alpine
|
||||||
|
|
||||||
RUN apk add --upgrade --no-cache bash gettext inotify-tools
|
RUN apk add --upgrade --no-cache gettext inotify-tools
|
||||||
RUN mv /etc/nginx /etc/nginx.tmpl
|
RUN mv /etc/nginx /etc/nginx.tmpl
|
||||||
RUN touch /etc/envsubst.conf
|
RUN touch /etc/envsubst.conf
|
||||||
|
|
||||||
|
|
|
@ -5,27 +5,10 @@ resources:
|
||||||
source:
|
source:
|
||||||
uri: https://gitea.redxef.at/redxef/nginx-envsubst
|
uri: https://gitea.redxef.at/redxef/nginx-envsubst
|
||||||
branch: master
|
branch: master
|
||||||
fetch_tags: true
|
|
||||||
- name: upstream-image
|
- name: upstream-image
|
||||||
type: registry-image
|
type: registry-image
|
||||||
check_every: 6h
|
|
||||||
source:
|
source:
|
||||||
repository: nginx
|
repository: alpine
|
||||||
tag: alpine
|
|
||||||
- name: image
|
|
||||||
type: oci-image
|
|
||||||
source:
|
|
||||||
repository: redxef/nginx-envsubst
|
|
||||||
tag: latest
|
|
||||||
username: ((docker.username))
|
|
||||||
password: ((docker.password))
|
|
||||||
|
|
||||||
resource_types:
|
|
||||||
- name: oci-image
|
|
||||||
type: registry-image
|
|
||||||
source:
|
|
||||||
repository: redxef/concourse-oci-resource
|
|
||||||
tag: latest
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
|
@ -68,18 +51,16 @@ jobs:
|
||||||
- name: source
|
- name: source
|
||||||
path: .
|
path: .
|
||||||
- name: docker-tags
|
- name: docker-tags
|
||||||
outputs:
|
|
||||||
- name: build-output
|
|
||||||
params:
|
params:
|
||||||
dest: build-output/image.tar
|
username: ((docker.username))
|
||||||
|
password: ((docker.password))
|
||||||
|
repository: docker.io/redxef/nginx-envsubst
|
||||||
|
tag: latest
|
||||||
|
additional_tags: docker-tags/tags.txt
|
||||||
|
push: true
|
||||||
platform: aarch64,arm,i386,ppc64le,s390x,x86_64
|
platform: aarch64,arm,i386,ppc64le,s390x,x86_64
|
||||||
|
context: .
|
||||||
|
manual: false
|
||||||
run:
|
run:
|
||||||
path: build
|
path: build
|
||||||
- put: image
|
|
||||||
inputs:
|
|
||||||
- build-output
|
|
||||||
- docker-tags
|
|
||||||
params:
|
|
||||||
image: build-output/image.tar
|
|
||||||
additional_tags: docker-tags/tags.txt
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
pids=""
|
pids=""
|
||||||
|
|
||||||
|
@ -36,16 +36,10 @@ run_nginx() {
|
||||||
}
|
}
|
||||||
|
|
||||||
run_inotifywait() {
|
run_inotifywait() {
|
||||||
while :; do
|
while find "$dstdir" -type f -exec \
|
||||||
wait_files="$(find "$dstdir" -type f -exec \
|
sed -En '/ssl_certificate/ s/^\s*ssl_certificate(_key)? (.*);.*$/\2/p' {} \; | sort | uniq | \
|
||||||
sed -En '/ssl_certificate/ s/^\s*ssl_certificate(_key)? (.*);.*$/\2/p' {} \; | sort -u)"
|
inotifywait --fromfile=-; do
|
||||||
wait_directories="$(echo "$wait_files" | xargs -n 1 dirname | sort -u)"
|
|
||||||
echo "monitoring the following files:"
|
|
||||||
echo "$wait_files"
|
|
||||||
matched_files="$(echo "$wait_directories" | inotifywait --fromfile=- -e close_write -e modify -e create)"
|
|
||||||
if [[ -n "$(comm -12 <(sort -u <<< "$matched_files") <(echo "$wait_files"))" ]]; then
|
|
||||||
nginx -s reload
|
nginx -s reload
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue