You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.5 KiB
YAML
80 lines
2.5 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: skip_tls_clone
|
|
image: plugins/git
|
|
settings:
|
|
depth: 10
|
|
skip_verify: true
|
|
|
|
- name: setup-virtualenv
|
|
image: python:3.7-alpine
|
|
commands:
|
|
- pip install virtualenv
|
|
- virtualenv /tmp/shared/.venv
|
|
- source /tmp/shared/.venv/bin/activate
|
|
- pip install -r requirements.txt
|
|
volumes:
|
|
- name: shared
|
|
path: /tmp/shared
|
|
|
|
- name: export
|
|
image: python:3.7-alpine
|
|
environment:
|
|
username:
|
|
from_secret: username
|
|
password:
|
|
from_secret: password
|
|
commands:
|
|
- export LC_ALL=de_DE@UTF-8
|
|
- apk add unzip wget make git curl openssh
|
|
- mkdir /tmp/content
|
|
- curl https://cloud.fdgl.rocks/index.php/s/wGLnSaTiL2rn5ae/download -o /tmp/content.zip
|
|
- unzip /tmp/content.zip -d /tmp
|
|
- cp -rf /tmp/Webseite/drafts/*.md drafts/
|
|
- cp -rf /tmp/Webseite/events/*.md events/
|
|
- cp -rf /tmp/Webseite/pages/*.md pages/
|
|
- cp -rf /tmp/Webseite/static/* static/
|
|
- source /tmp/shared/.venv/bin/activate
|
|
- nohup python3 app.py 2>&1 > /dev/null &
|
|
- sleep 3
|
|
- git clone https://git.omglinux.de/michael/fdgl-production.git /tmp/shared/target
|
|
- wget -mpEk http://127.0.0.1:5000 2>&1 > /dev/null || true
|
|
- cp -r 127.0.0.1:5000/* /tmp/shared/target
|
|
- cd /tmp/shared/target
|
|
- for i in $(ls *.html); do sed -i -e 's/\—/\–/g' -i -e 's/\Ä/\Ä/g' -i -e 's/\…/\…/g' -i -e 's/\ä/\ä/g' -i -e 's/\Ö/\Ö/g' -i -e 's/\ö/\ö/g' -i -e 's/\Ü/\Ü/g' -i -e 's/\ü/\ü/g' -i -e 's/\ß/\ß/g' -i -e 's/\^-/\–/g' -i -e 's/\^ /\ /g' -i -e 's/\^</\</g' -i -e 's/\^>/\>/g' -i -e 's/\^&/\&/g' -i -e 's/\^\^/\^/g' -i -e 's/\^x/\×/g' -i -e 's/\^r/\→/g' -i -e 's/\^b/\•/g' -i -e 's/\^e/\⇄/g' -i -e 's/\^§/\;§/g' $i; done
|
|
volumes:
|
|
- name: shared
|
|
path: /tmp/shared
|
|
|
|
- name: push
|
|
image: appleboy/drone-git-push
|
|
settings:
|
|
branch: main
|
|
remote: ssh://git@git.omglinux.de:2222/michael/fdgl-production.git
|
|
force: false
|
|
commit: true
|
|
commit_message: "Drone build ${DRONE_COMMIT_SHA:0:7}"
|
|
author_name: "Drone CI"
|
|
author_email: "drone@omglinux.de"
|
|
path: /tmp/shared/target
|
|
ssh_key:
|
|
from_secret: ssh_key
|
|
volumes:
|
|
- name: shared
|
|
path: /tmp/shared
|
|
|
|
- name: publish
|
|
image: python:3.7-alpine
|
|
commands:
|
|
- apk add curl
|
|
- curl -X POST https://a2ef7.netcup.net:8443/modules/git/public/web-hook.php?uuid=85a3b51d-0246-312f-8e2c-22adf8ceb4ac
|
|
|
|
volumes:
|
|
- name: shared
|
|
temp: {}
|
|
- name: docker-cache
|
|
host:
|
|
path: /var/cache/${DRONE_REPO_NAME}/docker |