Update and rework project structure with new pagebuilder concept. (based on RK Architekten and SFU Politik configs and sources)
This commit is contained in:
219
.drone.yml
219
.drone.yml
@@ -7,185 +7,112 @@ workspace:
|
||||
|
||||
steps:
|
||||
- name: load dependencies
|
||||
image: node
|
||||
pull: if-not-exists
|
||||
environment:
|
||||
FORCE_COLOR: "true"
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
image: node:18
|
||||
commands:
|
||||
- mkdir -p /cache/node_modules
|
||||
- mkdir -p /cache/user-cache
|
||||
- ln -s /cache/node_modules ./node_modules
|
||||
- ln -s /cache/user-cache ~/.cache
|
||||
- echo cache=/cache/npm-cache >> .npmrc
|
||||
- "echo 'enableGlobalCache: false' >> .yarnrc"
|
||||
- 'echo ''cacheFolder: "/cache/yarn-cache"'' >> .yarnrc'
|
||||
- 'echo ''yarn-offline-mirror "/cache/npm-packages-offline-cache"'' >> .yarnrc'
|
||||
- "echo 'yarn-offline-mirror-pruning: true' >> .yarnrc"
|
||||
- cat .yarnrc
|
||||
- yarn install --verbose --frozen-lockfile
|
||||
|
||||
- name: mongo
|
||||
image: mongo
|
||||
pull: if-not-exists
|
||||
detach: true
|
||||
|
||||
- name: maildev
|
||||
image: node
|
||||
pull: if-not-exists
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
commands:
|
||||
- yarn run maildev --web 80 --smtp 25 -v --hide-extensions=STARTTLS
|
||||
detach: true
|
||||
|
||||
- name: liveserver
|
||||
image: node
|
||||
pull: if-not-exists
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
commands:
|
||||
- yarn run -- live-server --no-browser --port=80 --ignore='*' --entry-file=spa.html --no-css-inject --proxy=/api:http://tibi-server:8080/api/v1/_/__NAMESPACE__ dist
|
||||
detach: true
|
||||
|
||||
- name: tibi-server
|
||||
image: registry.webmakers.de/tibi/tibi-server
|
||||
pull: never
|
||||
environment:
|
||||
DB_DIAL: mongodb://mongo
|
||||
API_PORT: 8080
|
||||
MAIL_HOST: maildev:25
|
||||
detach: true
|
||||
|
||||
- name: cypress run
|
||||
image: cypress/base
|
||||
pull: if-not-exists
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
environment:
|
||||
FORCE_COLOR: "true"
|
||||
CYPRESS_BASE_URL: http://liveserver
|
||||
CYPRESS_CI: "true"
|
||||
CYPRESS_mongodbUri: mongodb://mongo
|
||||
CYPRESS_tibiApiUrl: http://tibi-server:8080/api/v1
|
||||
CYPRESS_projectApiConfig: /drone/workdir/api/config.yml
|
||||
commands:
|
||||
- ln -s /cache/user-cache ~/.cache
|
||||
- yarn build:instanbul
|
||||
- yarn cy:run
|
||||
- yarn run nyc report --exclude-after-remap false
|
||||
- yarn install
|
||||
|
||||
- name: modify master config
|
||||
image: bash
|
||||
pull: if-not-exists
|
||||
commands:
|
||||
- bash scripts/modify-config.sh master __MASTER_URL__
|
||||
- bash scripts/modify-config.sh master https://tibi-svelte-starter.code.testversion.online/
|
||||
when:
|
||||
branch: [master]
|
||||
|
||||
- name: modify dev config
|
||||
image: bash
|
||||
pull: if-not-exists
|
||||
commands:
|
||||
- bash scripts/modify-config.sh dev __DEV_URL__
|
||||
when:
|
||||
branch: [dev]
|
||||
# - 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
|
||||
pull: if-not-exists
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
image: node:18
|
||||
commands:
|
||||
- yarn build
|
||||
|
||||
- name: build ssr
|
||||
image: node
|
||||
pull: if-not-exists
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
commands:
|
||||
- yarn build:server
|
||||
# - name: build admin
|
||||
# image: node:18
|
||||
# commands:
|
||||
# - yarn build:admin
|
||||
|
||||
- name: build legacy
|
||||
image: node
|
||||
pull: if-not-exists
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
commands:
|
||||
- yarn build:legacy
|
||||
# - 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
|
||||
pull: if-not-exists
|
||||
commands:
|
||||
- bash scripts/preload-meta.sh public/spa.html
|
||||
- bash scripts/preload-meta.sh public/spa.html > dist/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 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
|
||||
- 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 master
|
||||
image: instrumentisto/rsync-ssh
|
||||
pull: if-not-exists
|
||||
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: 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: deploy dev
|
||||
- name: copy api config to staging
|
||||
image: instrumentisto/rsync-ssh
|
||||
pull: if-not-exists
|
||||
environment:
|
||||
RSYNC_USER: USER_PROJECT_dev
|
||||
RSYNC_PASS:
|
||||
from_secret: rsync_dev
|
||||
volumes:
|
||||
- name: data
|
||||
path: /data
|
||||
commands:
|
||||
- apk add --no-cache sshpass
|
||||
- scripts/deploy.sh ftp1.webmakers.de $${RSYNC_USER} $${RSYNC_PASS}
|
||||
- rsync -av api /data/
|
||||
when:
|
||||
branch: [dev]
|
||||
event: [push]
|
||||
|
||||
- name: prepare notify
|
||||
image: cypress/base
|
||||
pull: if-not-exists
|
||||
- name: review in staging
|
||||
image: docker/compose:1.22.0
|
||||
commands:
|
||||
- find cypress -type f -wholename "cypress/videos/*" -or -wholename "cypress/screenshots/*" | tar -cvf cypress-media.tar -T -
|
||||
- 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:
|
||||
status:
|
||||
- failure
|
||||
branch: [dev]
|
||||
event: [push]
|
||||
|
||||
- name: notify
|
||||
image: drillster/drone-email
|
||||
pull: if-not-exists
|
||||
settings:
|
||||
from: noreply@ci.gitbase.de
|
||||
host: smtp.basehosts.de
|
||||
attachment: cypress-media.tar
|
||||
- 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:
|
||||
status:
|
||||
- failure
|
||||
branch: [master]
|
||||
event: [push]
|
||||
|
||||
########
|
||||
volumes:
|
||||
- name: cache
|
||||
- name: data
|
||||
host:
|
||||
path: /tmp/cache/drone/${DRONE_REPO}
|
||||
path: /data/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_BRANCH}
|
||||
- name: docker
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
Reference in New Issue
Block a user