-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devspace.yaml
executable file
·138 lines (130 loc) · 4.41 KB
/
devspace.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
version: v2beta1
name: once
vars:
STATE_SECRET: not-a-secret
IMAGE: 'ghcr.io/bottledcode/swytch/once'
RETHINKDB_HOST: rethinkdb-main-rethinkdb-proxy.main.svc.cluster.local
RETHINKDB_USER: swytch-once
RETHINKDB_PASSWORD: not-a-secret
RETHINKDB_DB: swytch-once
AUTH_LOGIN: https://auth.getswytch.com/login
AUTH_URL: http://swytch-auth.auth.svc.cluster.local/api/auth
HOST: once.getswytch.com
POSTMARK_API_KEY: not-a-secret
AUTH_HOST: auth.getswytch.com
PROBES: true
dependencies:
auth:
namespace: auth
branch: main-v2
git: https://github.com/bottledcode/swytch-auth.git
vars:
POSTMARK_API_KEY: ${POSTMARK_API_KEY}
OP_MODE: preview
HOSTS: '["${AUTH_HOST}"]'
# This is a list of `pipelines` that DevSpace can execute (you can define your own)
pipelines:
# This is the pipeline for the main command: `devspace dev` (or `devspace run-pipeline dev`)
dev:
run: |-
#run_dependencies --all
#loft use cluster
ensure_pull_secrets --all
create_deployments --all
#loft use vcluster
start_dev once
# You can run this pipeline via `devspace deploy` (or `devspace run-pipeline deploy`)
deploy:
run: |-
ensure_pull_secrets --all
build_images --all
devspace reset pods
create_deployments --all
build:
run: |-
loft wakeup space image-builder
run_dependencies --all --pipeline build
build_images --all
db-migrate:
run: |-
echo "Migrating database: waiting for pod to be ready..."
wait_pod --image-selector=ghcr.io/bottledcode/swytch/once
echo "Migrating database: running migrations..."
run_dependencies --all --pipeline db-migrate
exec_container --image-selector=ghcr.io/bottledcode/swytch/once php src/scripts/db.php $RETHINKDB_ADMIN_PASSWORD
# This is a list of `images` that DevSpace can build for this project
# We recommend to skip image building during development (devspace dev) as much as possible
images:
once:
image: ghcr.io/bottledcode/swytch/once
dockerfile: ./Dockerfile
target: prod
buildKit:
inCluster:
noLoad: true
name: builder
namespace: image-builder
# This is a list of `deployments` that DevSpace can create for this project
deployments:
once:
updateImageTags: true
name: swytch-once
# This deployment uses `helm` but you can also define `kubectl` deployments or kustomizations
helm:
# We are deploying this project with the Helm chart you provided
chart:
path: charts/deployment
# Under `values` we can define the values for this Helm chart used during `helm install/upgrade`
# You may also use `valuesFiles` to load values from files, e.g. valuesFiles: ["values.yaml"]
values:
image: ${IMAGE}
host: ${HOST}
probes: ${PROBES}
auth:
signinUrl: ${AUTH_LOGIN}
authUrl: ${AUTH_URL}
secrets:
stateSecret: ${STATE_SECRET}
rethinkdb:
host: ${RETHINKDB_HOST}
db: ${RETHINKDB_DB}
user: ${RETHINKDB_USER}
password: ${RETHINKDB_PASSWORD}
disableDependencyUpdate: false
# This is a list of `dev` containers that are based on the containers created by your deployments
dev:
once:
# Search for the container that runs this image
imageSelector: ghcr.io/bottledcode/swytch/once
# Replace the container image with this dev-optimized image (allows to skip image building during development)
devImage: ghcr.io/bottledcode/swytch/once
# Sync files between the local filesystem and the development container
sync:
- path: ./
# Open a terminal and use the following command to start it
terminal:
command: ./devspace_start.sh
reversePorts:
- bindAddress: '9003'
port: '9003'
# Make the following commands from my local machine available inside the dev container
proxyCommands:
- command: devspace
- command: kubectl
- command: helm
- gitCredentials: true
- command: composer
- command: git
# Use the `commands` section to define repeatable dev workflows for this project
commands:
clean:
command: |-
rm -rf vendor
rm -rf html/assets/compiled.css
# Define dependencies to other projects with a devspace.yaml
# dependencies:
# api:
# git: https://... # Git-based dependencies
# tag: v1.0.0
# ui:
# path: ./ui # Path-based dependencies (for monorepos)