forked from cms/tibi-svelte-starter
77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
|
kind: pipeline
|
||
|
type: docker
|
||
|
name: default
|
||
|
steps:
|
||
|
- name: load dependencies
|
||
|
image: node
|
||
|
commands:
|
||
|
- yarn install
|
||
|
|
||
|
- name: modify master config
|
||
|
image: bash
|
||
|
commands:
|
||
|
- bash scripts/modify-config.sh master __MASTER_URL__
|
||
|
when:
|
||
|
branch: [master]
|
||
|
|
||
|
- name: modify dev config
|
||
|
image: bash
|
||
|
commands:
|
||
|
- bash scripts/modify-config.sh dev __DEV_URL__
|
||
|
when:
|
||
|
branch: [dev]
|
||
|
|
||
|
- name: build
|
||
|
image: node
|
||
|
commands:
|
||
|
- yarn build
|
||
|
|
||
|
- name: build ssr
|
||
|
image: node
|
||
|
commands:
|
||
|
- yarn build:server
|
||
|
|
||
|
- name: build legacy
|
||
|
image: node
|
||
|
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 > dist/spa.html
|
||
|
- export stamp=`date +%s`
|
||
|
- echo $$stamp
|
||
|
- sed -i s/__TIMESTAMP__/$$stamp/g dist/spa.html
|
||
|
- sed -i s/__TIMESTAMP__/$$stamp/g dist/serviceworker.js
|
||
|
- cat dist/serviceworker.js
|
||
|
- cp dist/spa.html api/templates/spa.html
|
||
|
- cat dist/spa.html
|
||
|
|
||
|
- name: deploy master
|
||
|
image: instrumentisto/rsync-ssh
|
||
|
environment:
|
||
|
RSYNC_USER: USER_PROJECT_master
|
||
|
RSYNC_PASS:
|
||
|
from_secret: rsync_master
|
||
|
commands:
|
||
|
- apk add --no-cache sshpass
|
||
|
- scripts/deploy.sh ftp1.webmakers.de $${RSYNC_USER} $${RSYNC_PASS}
|
||
|
when:
|
||
|
branch: [master]
|
||
|
event: [push]
|
||
|
|
||
|
- name: deploy dev
|
||
|
image: instrumentisto/rsync-ssh
|
||
|
environment:
|
||
|
RSYNC_USER: USER_PROJECT_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]
|