|
|
|
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: serve
|
|
|
|
image: python:3.7-alpine
|
|
|
|
environment:
|
|
|
|
SSH_KEY:
|
|
|
|
from_secret: SSH_KEY
|
|
|
|
commands:
|
|
|
|
- apk add unzip wget make git curl ssh
|
|
|
|
- mkdir /root/.ssh && echo "$SSH_KEY" > /root/.ssh/id_rsa && chmod 0600 /root/.ssh/id_rsa
|
|
|
|
- git config --global user.name "Drone CI"
|
|
|
|
- git config --global user.email "drone@omglinux.de"
|
|
|
|
- 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 10
|
|
|
|
- git clone ssh://git@git.omglinux.de:2222/michael/fdgl-production.git /tmp/shared/target
|
|
|
|
- cd /tmp/shared/target
|
|
|
|
- wget -mpEk http://127.0.0.1:5000 2>&1 > /dev/null || true
|
|
|
|
- git add -A
|
|
|
|
- git commit -m "automatic commit $(date)"
|
|
|
|
- git push origin main
|
|
|
|
volumes:
|
|
|
|
- name: shared
|
|
|
|
path: /tmp/shared
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: shared
|
|
|
|
temp: {}
|
|
|
|
- name: docker-cache
|
|
|
|
host:
|
|
|
|
path: /var/cache/${DRONE_REPO_NAME}/docker
|