From 203c617e9ca4b490af48db431611581cdc8bc8ff Mon Sep 17 00:00:00 2001 From: Nick Slowinski Date: Sat, 8 Jul 2023 23:34:22 +0200 Subject: [PATCH] Add drone config --- .drone.yml | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..2d1ecd2 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,155 @@ +name: test +kind: pipeline +type: docker + +platform: + os: linux + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: registry.access.redhat.com/ubi9/python-311:1-12 + volumes: + - name: cache + path: /opt/app-root/src + commands: + - mkdir ~/docs && cd ~/docs + - git clone $DRONE_REPO_LINK . + - git checkout $DRONE_COMMIT +- name: build + image: registry.access.redhat.com/ubi9/python-311:1-12 + volumes: + - name: cache + path: /opt/app-root/src + commands: + - cd ~/docs + - pip install --upgrade pip + - pip install -r requirements.txt + - make html + +trigger: + event: + - push + - pull_request +volumes: +- name: cache + temp: {} + +--- +name: deploy to staging +kind: pipeline +type: docker + +platform: + os: linux + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: registry.access.redhat.com/ubi9/python-311:1-12 + volumes: + - name: cache + path: /opt/app-root/src + commands: + - mkdir ~/docs && cd ~/docs + - git clone $DRONE_REPO_LINK . + - git checkout $DRONE_COMMIT +- name: build + image: registry.access.redhat.com/ubi9/python-311:1-12 + volumes: + - name: cache + path: /opt/app-root/src + commands: + - cd ~/docs + - pip install --upgrade pip + - pip install -r requirements.txt + - make html +- name: deploy to staging + image: appleboy/drone-scp + volumes: + - name: cache + path: /opt/app-root/src + settings: + host: helene.nick-slowinski.de + username: drone_nick-slowinski_de-docs + key: + from_secret: ssh_private_key-drone_nick-slowinski_de-docs + target: /var/www/nick-slowinski.de/docs/staging + source: /opt/app-root/src/docs/build + rm: true + overwrite: true + strip_components: 5 + +trigger: + event: + - promote + target: + - staging + +volumes: +- name: cache + temp: {} + +--- +name: deploy to production +kind: pipeline +type: docker + +platform: + os: linux + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: registry.access.redhat.com/ubi9/python-311:1-12 + volumes: + - name: cache + path: /opt/app-root/src + commands: + - mkdir ~/docs && cd ~/docs + - git clone $DRONE_REPO_LINK . + - git checkout $DRONE_COMMIT +- name: build + image: registry.access.redhat.com/ubi9/python-311:1-12 + volumes: + - name: cache + path: /opt/app-root/src + commands: + - cd ~/docs + - pip install --upgrade pip + - pip install -r requirements.txt + - make html +- name: deploy to production + image: appleboy/drone-scp + volumes: + - name: cache + path: /opt/app-root/src + settings: + host: helene.nick-slowinski.de + username: drone_nick-slowinski_de-docs + key: + from_secret: ssh_private_key-drone_nick-slowinski_de-docs + target: /var/www/nick-slowinski.de/docs/production + source: /opt/app-root/src/docs/build + rm: true + overwrite: true + strip_components: 5 + +trigger: + event: + - promote + target: + - production + +volumes: +- name: cache + temp: {} \ No newline at end of file