Compare commits

...

9 커밋

작성자 SHA1 메시지 날짜
7ad3901960 fix: pass public url
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-24 14:59:12 +01:00
76888be1b9 Merge branch 'main' of ssh://git.autonomic.zone:2222/ruangrupa/lumbung-kios-cms
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-24 14:09:34 +01:00
057c3393a4 docs: auto-deploy [ci skip] 2023-01-24 13:24:55 +01:00
23a8bf752d Feat: Adding the collections 2023-01-24 13:20:27 +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
10개의 변경된 파일198개의 추가작업 그리고 35개의 파일을 삭제

파일 보기

@ -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

파일 보기

@ -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).

파일 보기

@ -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,14 @@ services:
PORT: 3000
NODE_ENV: production
PAYLOAD_SECRET_FILE: /run/secrets/payload_secret
PAYLOAD_CONFIG_PATH: /home/node/dist/payload.config.js
PAYLOAD_PUBLIC_SERVER_URL: https://kios-admin.lumbung.space
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 +31,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 +51,7 @@ volumes:
data:
networks:
internal:
proxy:
external: true

파일 보기

@ -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

파일 보기

@ -0,0 +1,17 @@
import { CollectionConfig } from 'payload/types';
const Couriers: CollectionConfig = {
slug: 'couriers',
access: {
read: () => true,
},
fields: [
{
name: 'name', // required
type: 'text', // required
required: true,
},
],
};
export default Couriers;

파일 보기

@ -0,0 +1,67 @@
import { CollectionConfig } from 'payload/types';
const Dispatches: CollectionConfig = {
slug: 'dispatches',
// admin: {
// useAsTitle: 'email',
// },
access: {
read: () => true,
},
fields: [
{
name: 'dispatchesCode',
type: 'text',
required: true,
},
{
name: 'products',
type: 'relationship',
relationTo: 'products',
hasMany: true,
},
{
name: 'startingPoint',
type: 'relationship',
relationTo: 'makers',
hasMany: false,
},
{
name: 'endPoint',
type: 'relationship',
relationTo: 'makers',
hasMany: false,
},
{
name: 'courier',
type: 'relationship',
relationTo: 'couriers',
hasMany: false,
},
{
name: 'status', // required
type: 'select', // required
hasMany: true,
// admin: {
// isClearable: true,
// isSortable: true, // use mouse to drag and drop different values, and sort them according to your choice
// },
options: [
{
label: 'Route requested',
value: 'routeRequested',
},
{
label: 'In transit',
value: 'inTransit',
},
{
label: 'Completed',
value: 'completed',
},
],
}
],
};
export default Dispatches;

32
src/collections/Makers.ts Normal file
파일 보기

@ -0,0 +1,32 @@
import { CollectionConfig } from 'payload/types';
const Makers: CollectionConfig = {
slug: 'makers',
// admin: {
// useAsTitle: 'email',
// },
access: {
read: () => true,
},
fields: [
{
name: 'name', // required
type: 'text', // required
required: true,
},
{
name: 'location',
type: 'point',
label: 'Location',
},
{
name: 'products', // required
type: 'relationship', // required
relationTo: 'products', // required
hasMany: true,
// TODO: make the name of the product visible in the dropdown
}
],
};
export default Makers;

파일 보기

@ -0,0 +1,20 @@
import { CollectionConfig } from 'payload/types';
const Products: CollectionConfig = {
slug: 'products',
// admin: {
// useAsTitle: 'email',
// },
access: {
read: () => true,
},
fields: [
{
name: 'productTitle', // required
type: 'text', // required
required: true,
},
],
};
export default Products;

파일 보기

@ -0,0 +1,31 @@
import { CollectionConfig } from 'payload/types';
const Retailers: CollectionConfig = {
slug: 'retailers',
// admin: {
// useAsTitle: 'email',
// },
access: {
read: () => true,
},
fields: [
{
name: 'name', // required
type: 'text', // required
required: true,
},
{
name: 'location',
type: 'point',
label: 'Location',
},
{
name: 'products', // required
type: 'relationship', // required
relationTo: 'products', // required
hasMany: true,
}
],
};
export default Retailers;

파일 보기

@ -2,6 +2,12 @@ import { buildConfig } from 'payload/config';
import path from 'path';
// import Examples from './collections/Examples';
import Users from './collections/Users';
import Couriers from './collections/Couriers';
import Dispatches from './collections/Dispatches';
import Makers from './collections/Makers';
import Products from './collections/Products';
import Retailers from './collections/Retailers';
export default buildConfig({
serverURL: 'http://localhost:3000',
@ -10,8 +16,11 @@ export default buildConfig({
},
collections: [
Users,
// Add Collections here
// Examples,
Couriers,
Dispatches,
Makers,
Products,
Retailers,
],
typescript: {
outputFile: path.resolve(__dirname, 'payload-types.ts'),