Move docker creation over to devenv
This is not ideal, since devenv is more for creating development environments, but it works
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
# environment variables necessary to run:
|
||||
# REPO_URL the url of this repo
|
||||
# BRANCH the branch to work at
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
RUN apk add --no-cache git bash
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
COPY update.sh /update.sh
|
||||
RUN chmod +x /update.sh
|
||||
|
||||
# Add the cron job to run every 30 minutes
|
||||
# Redirecting to /proc/1/fd/1 ensures the script's echo statements show up in `docker logs`
|
||||
RUN echo "*/30 * * * * bash /update.sh > /proc/1/fd/1 2>&1" > /etc/crontabs/root
|
||||
|
||||
# Start the cron daemon in the background (-b) and nginx in the foreground
|
||||
CMD crond -b && nginx -g 'daemon off;'
|
||||
@@ -0,0 +1,13 @@
|
||||
server {
|
||||
listen 8080;
|
||||
server_name = fdroid.julian-mutter.de;
|
||||
|
||||
location = / {
|
||||
return 302 /fdroid/repo;
|
||||
}
|
||||
|
||||
location /fdroid/repo {
|
||||
alias /repo/fdroid/repo/;
|
||||
autoindex on;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
events {}
|
||||
http {
|
||||
server {
|
||||
listen 80;
|
||||
server_name = fdroid.julian-mutter.de;
|
||||
|
||||
location = / {
|
||||
return 302 /fdroid/repo;
|
||||
}
|
||||
|
||||
location /fdroid/repo {
|
||||
alias /repo/fdroid/repo/;
|
||||
autoindex on;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+11
-6
@@ -1,12 +1,17 @@
|
||||
#! /bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -d "/code/.git" ]; then
|
||||
# Config
|
||||
REPO_URL="https://gitlab.julian-mutter.de/julian/fdroid-frajul"
|
||||
BRANCH="master"
|
||||
|
||||
if [ ! -d "./code/.git" ]; then
|
||||
echo "Performing initial setup!"
|
||||
mkdir /code
|
||||
echo "Current working directory: $(pwd)"
|
||||
mkdir ./code
|
||||
echo "Cloning repository..."
|
||||
git clone --branch "$BRANCH" "$REPO_URL" "/code"
|
||||
git clone --branch "$BRANCH" "$REPO_URL" "./code"
|
||||
echo "Decrypting secrets..."
|
||||
cd /code
|
||||
cd ./code
|
||||
./scripts/decrypt.sh
|
||||
echo "Done"
|
||||
fi
|
||||
@@ -14,7 +19,7 @@ fi
|
||||
echo "Running regular repo update..."
|
||||
echo ""
|
||||
|
||||
cd "/code"
|
||||
cd "./code"
|
||||
git fetch origin
|
||||
LOCAL=$(git rev-parse HEAD)
|
||||
REMOTE=$(git rev-parse "origin/$BRANCH")
|
||||
|
||||
Reference in New Issue
Block a user