forked from melpa/melpa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update MELPA to build both unstable and stable. (melpa#5612)
- Combine stable and unstable builds into the same rotation so one builds after the other. - Move all the services to docker containers, - nginx: contains everything for handling http traffic including log rotation and ssl certs. - syncer: manages syncing all the html files to the latest build information. - logprocessor: processes the http logs. - rsyncd: rsync for melpa repo.
- Loading branch information
1 parent
b623ce3
commit 176e0e6
Showing
48 changed files
with
483 additions
and
427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM debian:unstable | ||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install emacs25-nox git make mercurial ruby | ||
WORKDIR /mnt/store/melpa | ||
CMD docker/builder/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash -e | ||
|
||
MELPA_REPO=/mnt/store/melpa | ||
cd "${MELPA_REPO}" | ||
MELPA_BRANCH=$( git rev-parse --abbrev-ref HEAD ) | ||
|
||
STATUS_JSON=${MELPA_REPO}/html/build-status.json | ||
LAST_DURATION_FILE=${MELPA_REPO}/html/.last-build-duration | ||
STABLE_STATUS_JSON=${MELPA_REPO}/html-stable/build-status.json | ||
STABLE_LAST_DURATION_FILE=${MELPA_REPO}/html-stable/.last-build-duration | ||
|
||
## update MELPA repo | ||
git fetch origin | ||
git reset --hard "origin/${MELPA_BRANCH}" | ||
git pull origin "${MELPA_BRANCH}" | ||
echo | ||
|
||
update_json() { | ||
cat <<EOF > $BUILD_STATUS_JSON | ||
{ | ||
"started": $BUILD_STARTED, | ||
"completed": ${BUILD_COMPLETED-null}, | ||
"next": ${BUILD_NEXT-null}, | ||
"duration": ${BUILD_DURATION-null} | ||
} | ||
EOF | ||
echo "Writing $BUILD_STATUS_JSON" | ||
cat "$BUILD_STATUS_JSON" | ||
} | ||
|
||
flux_capacitor() { | ||
|
||
if [ -f "$BUILD_LAST_DURATION_FILE" ]; then | ||
BUILD_DURATION=$(cat "$BUILD_LAST_DURATION_FILE") | ||
fi | ||
|
||
|
||
BUILD_STARTED=$(date "+%s") | ||
update_json | ||
|
||
# Build all the packages. | ||
docker/builder/parallel_build_all | ||
|
||
# Store completed date | ||
BUILD_COMPLETED=$(date "+%s") | ||
BUILD_DURATION=$((BUILD_COMPLETED - BUILD_STARTED)) | ||
echo -n "$BUILD_DURATION" > $BUILD_LAST_DURATION_FILE | ||
BUILD_NEXT=$((BUILD_COMPLETED + BUILD_DELAY)) | ||
update_json | ||
|
||
} | ||
|
||
unset STABLE | ||
|
||
BUILD_STATUS_JSON=${STATUS_JSON} | ||
BUILD_LAST_DURATION_FILE=${LAST_DURATION_FILE} | ||
if [ -f "$STABLE_LAST_DURATION_FILE" ]; then | ||
BUILD_DELAY=$(cat "$STABLE_LAST_DURATION_FILE") | ||
fi | ||
|
||
flux_capacitor | ||
|
||
# stable build | ||
export STABLE=t | ||
|
||
BUILD_STATUS_JSON=${STABLE_STATUS_JSON} | ||
BUILD_LAST_DURATION_FILE=${STABLE_LAST_DURATION_FILE} | ||
if [ -f "$LAST_DURATION_FILE" ]; then | ||
BUILD_DELAY=$(cat "$LAST_DURATION_FILE") | ||
fi | ||
|
||
flux_capacitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
version: "3" | ||
services: | ||
nginx: | ||
build: ./nginx | ||
image: melpa/nginx:v1 | ||
restart: unless-stopped | ||
volumes: | ||
- /mnt/store/melpa:/mnt/store/melpa:ro | ||
- /mnt/store/letsencrypt:/etc/letsencrypt | ||
- /mnt/store/log:/mnt/store/log | ||
- /mnt/store/log-stable:/mnt/store/log-stable | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
builder: | ||
build: ./builder | ||
image: melpa/builder:v1 | ||
restart: unless-stopped | ||
volumes: | ||
- /mnt/store/melpa:/mnt/store/melpa | ||
logprocessor: | ||
build: ./logprocessor | ||
image: melpa/logprocessor:v1 | ||
restart: unless-stopped | ||
volumes: | ||
- /mnt/db:/mnt/db | ||
- /mnt/store/melpa:/mnt/store/melpa | ||
- /mnt/store/log:/mnt/store/log:ro | ||
- /mnt/store/log-stable:/mnt/store/log-stable:ro | ||
syncer: | ||
build: ./syncer | ||
image: melpa/syncer:v1 | ||
restart: unless-stopped | ||
volumes: | ||
- /mnt/store/melpa:/mnt/store/melpa | ||
rsyncd: | ||
build: ./rsyncd | ||
image: melpa/rsyncd:v1 | ||
restart: unless-stopped | ||
ports: | ||
- "873:873" | ||
volumes: | ||
- /mnt/store/melpa/packages:/packages:ro | ||
- /mnt/store/melpa/packages-stable:/packages-stable:ro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM debian:unstable | ||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install python | ||
WORKDIR /mnt/store/melpa | ||
CMD docker/logprocessor/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash -e | ||
|
||
MELPA_REPO=/mnt/store/melpa | ||
cd "${MELPA_REPO}" | ||
|
||
unset STABLE | ||
/usr/bin/python ${MELPA_REPO}/docker/logprocessor/process_log.py | ||
|
||
export STABLE=t | ||
/usr/bin/python ${MELPA_REPO}/docker/logprocessor/process_log.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM nginx:alpine | ||
RUN apk add --no-cache certbot openssl logrotate | ||
COPY default.conf /etc/nginx/conf.d/ | ||
COPY logrotate /etc/logrotate | ||
WORKDIR /mnt/store/melpa | ||
CMD docker/nginx/run.sh |
Oops, something went wrong.