use modern drone syntax, dronr-native hugo build, and better way to get signatures

lektura
max.mehl 2021-03-05 13:07:35 +01:00
parent f728e46861
commit fc1fd4e2c2
No known key found for this signature in database
GPG Key ID: 2704E4AB371E2E92
4 changed files with 54 additions and 54 deletions

View File

@ -1,27 +1,44 @@
pipeline:
syntaxcheck:
image: monachus/hugo:v0.70.0
commands:
- cd site; ./build/build.sh syntax
---
kind: pipeline
name: default
deploy:
image: tmaier/docker-compose
commands:
# Install git
- apk add -q git
steps:
- name: copy-sigs
image: alpine:3
commands:
- cp /tmp/signatures.json site/data/signatures/signatures.json
volumes:
- name: signatures
path: /tmp/signatures.json
# Clone the git remository
# Make the signatures file available to the PMPC website
# Build the docker container
# Clean things up
- git clone https://git.fsfe.org/pmpc/website.git /tmp/pmpc-build && cd /tmp/pmpc-build/ && cp /tmp/signatures/signatures.json site/data/signatures/signatures.json && docker build -t pmpc .
- name: hugo
image: plugins/hugo
settings:
source: site
validate: true
# Run docker compose
- docker-compose up -d
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /srv/forms/pmpc:/tmp/signatures:ro
when:
event: [push, tag, deployment, cron]
branch: master
- name: deploy
image: docker/compose:1.24.0
commands:
- docker-compose up --build -d
volumes:
- name: dockersock
path: /var/run/docker.sock
when:
branch:
- master
event:
- push
- tag
- deployment
- cron
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
- name: signatures
host:
path: /srv/forms/pmpc/signatures.json
...

View File

@ -9,12 +9,12 @@
RedirectMatch permanent "^/zh_tw/?(.*)$" "/zh-tw/$1"
ServerAdmin contact@fsfe.org
DocumentRoot /usr/share/blog/public/
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /usr/share/blog/public/>
<Directory /var/www/html/>
Options FollowSymLinks Includes
AllowOverride All
Order allow,deny

View File

@ -1,27 +1,9 @@
FROM php:7-apache
ENV HUGO_VERSION 0.70.0
ENV HUGO_BINARY hugo_${HUGO_VERSION}_Linux-64bit.deb
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y git
RUN a2enmod rewrite
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} /tmp/hugo.deb
RUN dpkg -i /tmp/hugo.deb && \
rm /tmp/hugo.deb
RUN mkdir -p /usr/share/blog
COPY . /tmp/pmpc-build/
WORKDIR /tmp/pmpc-build/site/
RUN build/build.sh && \
cp -r public/ /usr/share/blog/public/ && \
cd / && rm -rf /tmp/pmpc-build
COPY site/public/ /var/www/html
COPY 000-default.conf /etc/apache2/sites-enabled/
RUN a2enmod rewrite
CMD apache2-foreground

View File

@ -1,22 +1,23 @@
version: '3'
services:
pmpc:
image: pmpc
container_name: pmpc
build: .
image: pmpc
restart: always
environment:
- HUGO_BASE_URL=https://publiccode.eu/
- VIRTUAL_HOST=publiccode.eu,www.publiccode.eu
- LETSENCRYPT_HOST=publiccode.eu,www.publiccode.eu
- LETSENCRYPT_EMAIL=contact@fsfe.org
logging:
driver: json-file
options:
max-size: "5m"
max-file: "5"
volumes:
- /srv/pmpc-cred:/srv/cred:ro
environment:
- VIRTUAL_HOST=publiccode.eu,www.publiccode.eu
- LETSENCRYPT_HOST=publiccode.eu,www.publiccode.eu
- LETSENCRYPT_EMAIL=contact@fsfe.org
# Connect the container which exposes the service to the 'bridge' network as
# this is where the reverse proxy is
connect-bridge:
image: docker:dind
volumes: