Commit 8a52473a authored by Carlo Landmeter's avatar Carlo Landmeter

initial commit

parents
Pipeline #2287 failed with stages
in 7 minutes and 53 seconds
config.lua
ssh
include:
- project: 'alpine/infra/gitlab-ci-templates'
ref: master
file: '/docker-image.yml'
FROM alpine:edge
ENV VERSION=master
ENV NQDIR=/tmp
RUN apk add --no-cache git openssh-client nq lua5.3-cjson lua5.3-http \
lua5.3-lustache lua5.3-lyaml lua-penlight mqtt-exec && \
mkdir -p /usr/share/alpine-mirror-status /var/www/localhost/htdocs && \
wget -qO- https://github.com/alpinelinux/alpine-mirror-status/archive/$VERSION.tar.gz | \
tar -zx --strip-components=1 -C /usr/share/alpine-mirror-status
COPY scripts /usr/local/bin
CMD mqtt-exec -h msg.alpinelinux.org -p 8883 --cafile /etc/ssl/cert.pem -v \
-t git/infra/mirrors/master -- /usr/bin/nq update.sh
version: '3.7'
services:
mirrors:
image: alpinelinux/update-mirrors
init: true
tty: true
build: .
volumes:
- "./ssh:/root/.ssh"
- "./config.lua:/usr/share/alpine-mirror-status/config.lua"
- "htdocs:/var/www/localhost/htdocs"
httpd:
image: alpinelinux/darkhttpd
user: 1000:1000
ports:
- 8080:8080
volumes:
- "htdocs:/var/www/localhost/htdocs"
labels:
traefik.enable: "true"
traefik.frontend.rule: 'Host: mirrors.alpinelinux.org'
traefik.port: 8080
networks:
web:
volumes:
htdocs:
networks:
web:
external: true
#!/bin/sh
BASEDIR=/usr/share/alpine-mirror-status
MIRRORDIR=/var/lib/mirrors
WEBDIR=/var/www/localhost/htdocs
exec > $(tty) 2>&1
if [ -d "$MIRRORDIR" ]; then
cd "$MIRRORDIR" && git pull
else
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
git clone git@git.alpinelinux.org:infra/mirrors "$MIRRORDIR"
fi
cd "$BASEDIR"
./generate-mirrors-json.lua "$MIRRORDIR"/private.yaml "$WEBDIR"
./generate-json.lua debug && ./generate-html.lua
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment