generated from cms/tibi-svelte-starter
119 lines
3.2 KiB
YAML
119 lines
3.2 KiB
YAML
|
kind: pipeline
|
||
|
type: docker
|
||
|
name: default
|
||
|
|
||
|
workspace:
|
||
|
path: /drone/workdir
|
||
|
|
||
|
steps:
|
||
|
- name: load dependencies
|
||
|
image: node:18
|
||
|
commands:
|
||
|
- yarn install
|
||
|
|
||
|
- name: modify master config
|
||
|
image: bash
|
||
|
commands:
|
||
|
- bash scripts/modify-config.sh master https://tibi-svelte-starter.code.testversion.online/
|
||
|
when:
|
||
|
branch: [master]
|
||
|
|
||
|
# - name: modify dev config
|
||
|
# image: bash
|
||
|
# commands:
|
||
|
# - bash scripts/modify-config.sh dev http://tibi-svelte-starter.code.testversion.online/
|
||
|
# when:
|
||
|
# branch: [dev]
|
||
|
|
||
|
- name: build
|
||
|
image: node:18
|
||
|
commands:
|
||
|
- yarn build
|
||
|
|
||
|
# - name: build admin
|
||
|
# image: node:18
|
||
|
# commands:
|
||
|
# - yarn build:admin
|
||
|
|
||
|
# - name: build ssr
|
||
|
# image: node:18
|
||
|
# commands:
|
||
|
# - yarn build:server
|
||
|
|
||
|
# - name: build legacy
|
||
|
# image: node:18
|
||
|
# commands:
|
||
|
# - yarn build:legacy
|
||
|
|
||
|
- name: modify html
|
||
|
image: bash
|
||
|
commands:
|
||
|
- bash scripts/preload-meta.sh public/spa.html
|
||
|
- bash scripts/preload-meta.sh public/spa.html > frontend/spa.html
|
||
|
- export stamp=`date +%s`
|
||
|
- echo $$stamp
|
||
|
- sed -i s/__TIMESTAMP__/$$stamp/g frontend/spa.html
|
||
|
- sed -i s/__TIMESTAMP__/$$stamp/g frontend/serviceworker.js
|
||
|
- cat frontend/serviceworker.js
|
||
|
- cp frontend/spa.html api/templates/spa.html
|
||
|
- cat frontend/spa.html
|
||
|
- cat api/templates/spa.html
|
||
|
|
||
|
# - name: deploy dev
|
||
|
# image: instrumentisto/rsync-ssh
|
||
|
# environment:
|
||
|
# RSYNC_USER: rkarchitekten_rsync_dev
|
||
|
# RSYNC_PASS:
|
||
|
# from_secret: rsync_dev
|
||
|
# commands:
|
||
|
# - apk add --no-cache sshpass
|
||
|
# - scripts/deploy.sh ftp1.webmakers.de $${RSYNC_USER} $${RSYNC_PASS}
|
||
|
# when:
|
||
|
# branch: [dev]
|
||
|
# event: [push]
|
||
|
|
||
|
- name: copy api config to staging
|
||
|
image: instrumentisto/rsync-ssh
|
||
|
volumes:
|
||
|
- name: data
|
||
|
path: /data
|
||
|
commands:
|
||
|
- rsync -av api /data/
|
||
|
when:
|
||
|
branch: [dev]
|
||
|
event: [push]
|
||
|
|
||
|
- name: review in staging
|
||
|
image: docker/compose:1.22.0
|
||
|
commands:
|
||
|
- docker-compose -p ${DRONE_BRANCH}-${DRONE_REPO_NAME}-${DRONE_REPO_OWNER} up -d --build --remove-orphans
|
||
|
volumes:
|
||
|
- name: docker
|
||
|
path: /var/run/docker.sock
|
||
|
when:
|
||
|
branch: [dev]
|
||
|
event: [push]
|
||
|
|
||
|
- name: deploy master
|
||
|
image: instrumentisto/rsync-ssh
|
||
|
environment:
|
||
|
RSYNC_USER: rkarchitekten_rsync_master
|
||
|
RSYNC_PASS:
|
||
|
from_secret: rsync_master
|
||
|
commands:
|
||
|
- apk add --no-cache sshpass curl
|
||
|
- scripts/deploy.sh ftp1.webmakers.de $${RSYNC_USER} $${RSYNC_PASS}
|
||
|
- curl -X POST "https://tibi-svelte-starter.code.testversion.online//api/ssr?token=__SSR_TOKEN__&clear=1"
|
||
|
when:
|
||
|
branch: [master]
|
||
|
event: [push]
|
||
|
|
||
|
########
|
||
|
volumes:
|
||
|
- name: data
|
||
|
host:
|
||
|
path: /data/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_BRANCH}
|
||
|
- name: docker
|
||
|
host:
|
||
|
path: /var/run/docker.sock
|