Compare commits

...

6 Commits

Author SHA1 Message Date
057c3393a4 docs: auto-deploy [ci skip] 2023-01-24 13:24:55 +01:00
f354eda75a unfuck router
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-24 17:20:25 +05:00
a016159bab hacking until works
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-24 17:18:39 +05:00
637089aa42 fix: missing env var for deploy
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
2023-01-24 12:50:41 +01:00
920def3123 docs: build badge [ci skip]
Some checks failed
continuous-integration/drone Build is failing
2023-01-24 12:42:59 +01:00
0df02e995d Merge pull request 'feat: ci/cd deploy' (#1) from ci-cd-deployment into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #1
2023-01-24 12:42:39 +01:00
4 changed files with 19 additions and 33 deletions

View File

@ -17,6 +17,7 @@ steps:
environment:
STACK_NAME: kios_admin_lumbung_space
SECRET_PAYLOAD_SECRET_VERSION: v1
APP_ENTRYPOINT_VERSION: v1
settings:
stack: kios_admin_lumbung_space
host: lumbung.space

View File

@ -1,9 +1,13 @@
# lumbung-kiosk-cms
[![Build Status](https://drone.autonomic.zone/api/badges/ruangrupa/lumbung-kios-cms/status.svg?ref=refs/heads/main)](https://drone.autonomic.zone/ruangrupa/lumbung-kios-cms)
This project was created using create-payload-app using the ts-blank template.
## How to Use
`yarn dev` will start up your application and reload on any changes.
If you have docker and docker-compose installed, you can run `docker-compose up`
## Deploy
Push commits, it will auto-deploy to [kios-admin.lumbung.space](https://kios-admin.lumbung.space).

View File

@ -6,6 +6,7 @@ services:
image: decentral1se/kios-admin:latest
networks:
- proxy
- internal
volumes:
- app:/home/node/app
- node_modules:/home/node/app/node_modules
@ -14,10 +15,13 @@ services:
PORT: 3000
NODE_ENV: production
PAYLOAD_SECRET_FILE: /run/secrets/payload_secret
PAYLOAD_CONFIG_PATH: /home/node/dist/payload.config.js
configs:
- source: app_entrypoint
target: /docker-entrypoint.sh
mode: 0555
entrypoint: /docker-entrypoint.sh
command: node dist/server.js
secrets:
- payload_secret
deploy:
@ -26,19 +30,19 @@ services:
order: start-first
labels:
- "traefik.enable=true"
- "traefik.http.routers.coop-cloud-site.rule=Host(`kios-admin.lumbung.space`, `www.kios-admin.lumbung.space`)"
- "traefik.http.routers.coop-cloud-site.entrypoints=web-secure"
- "traefik.http.services.coop-cloud-site.loadbalancer.server.port=3000"
- "traefik.http.routers.coop-cloud-site.tls.certresolver=production"
- "traefik.http.routers.kios-admin.rule=Host(`kios-admin.lumbung.space`, `www.kios-admin.lumbung.space`)"
- "traefik.http.routers.kios-admin.entrypoints=web-secure"
- "traefik.http.services.kios-admin.loadbalancer.server.port=3000"
- "traefik.http.routers.kios-admin.tls.certresolver=production"
db:
image: mongo:6.0.3
networks:
- internal
command:
- "--storageEngine=wiredTiger"
volumes:
- data:/data/db
logging:
driver: none
volumes:
app:
@ -46,6 +50,7 @@ volumes:
data:
networks:
internal:
proxy:
external: true

View File

@ -1,29 +1,5 @@
#!/bin/bash
#!/bin/sh
set -e
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "PAYLOAD_SECRET"
export PAYLOAD_SECRET=$(cat /run/secrets/payload_secret)
node dist/server.js