forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevspace.yaml
executable file
·135 lines (122 loc) · 3.97 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
# Copyright 2023 Yugabyte, Inc. and Contributors
#
# Licensed under the Polyform Free Trial License 1.0.0 (the "License"); you
# may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# https://github.com/YugaByte/yugabyte-db/blob/master/licenses/
# POLYFORM-FREE-TRIAL-LICENSE-1.0.0.txt
# DevSpace cofiguration file to develop YBA on Kubernetes. Local
# changes are synced with the Pod running in a Kubernetes cluster.
# https://www.devspace.sh/docs/getting-started/installation?x0=4
version: v2beta1
name: yugabyte-db-anywhere-git
pipelines:
dev:
run: |-
# ensure_pull_secrets --all # 2. Ensure pull secrets
echo "Deploying YBA tag ${YB_IMAGE_TAG} on the cluster"
echo "You can override this by running 'export YB_IMAGE_TAG=<custom tag>'"
create_deployments --all
echo "Building the YBA UI"
sbt uIBuild
echo "Building YBA"
sbt devSpaceReload
echo "Starting the development mode"
echo "You can run a build with 'sbt devSpaceReload' after code modifications"
start_dev yba
deployments:
yba:
helm:
chart:
name: ../../charts/stable/yugaware/
values:
image:
repository: quay.io/yugabyte/yugaware-itest
tag: ${YB_IMAGE_TAG}
yugaware:
service:
type: ClusterIP
storage: 100Gi
storageClass: yb-standard
# valuesFiles:
# -
dev:
yba:
imageSelector: quay.io/yugabyte/yugaware-itest
container: yugaware
sync:
- path: ./${YB_SYNC_DIR}:./
printLogs: true
# Don't delete files from remote
initialSync: preferLocal
# Minimize the number of files we upload
initialSyncCompareBy: size
excludePaths:
- '**'
# Only sync these files
- '!/bin/'
- '!/conf/'
- '!/kanela-agent/'
- '!/lib/'
- '!/README.md'
startContainer: true
onUpload:
restartContainer: true
disableDownload: true
ports:
- port: 9000
# Prometheus
- port: 9090
logs:
enabled: true
lastLines: 200
patches:
# Since we run as non-root user the /.devspace is not writable, so
# we create emptyDir volume which is writable by the group with
# which process runs, we have fsGroup set.
- op: add
path: spec.volumes
value:
name: devspace-script-dir
emptyDir: {}
- op: add
path: spec.containers.name=yugaware.volumeMounts
value:
mountPath: /.devspace
name: devspace-script-dir
command:
- "bin/yugaware"
- "-Dconfig.file=/data/application.docker.conf"
- "-DAPPLICATION_CONSOLE_LOG_LEVEL=${YBA_LOG_LEVEL}"
args: []
commands:
# Can be run with `devspace run extract-archive`
extract-archive:
description: |
Extract the build archive to staging directory, and copy over
only the modified files to the sync directory. DevSpace doesn't
support hash based file comparison, so we use rsync locally.
Build archive -> Staging directory -(rsync)-> Sync directory ->
Container.
command: |-
rm -rf "${YB_SYNC_STAGE_DIR}"
mkdir -p "${YB_SYNC_STAGE_DIR}"
# tar -xf "target/universal/yugaware-${YB_VERSION}.txz" -C "${YB_SYNC_STAGE_DIR}"
echo "Extracting the build archive"
unzip -q "target/universal/yugaware-${YB_VERSION}.zip" -d "${YB_SYNC_STAGE_DIR}"
mkdir -p "${YB_SYNC_DIR}"
rsync --recursive --itemize-changes --checksum --delete \
"${YB_SYNC_STAGE_DIR}" "${YB_SYNC_DIR}"
vars:
# This directory is used as a staging area to extract the build
# tars.
YB_SYNC_STAGE_DIR: "target/universal/devspace-stage/"
# The directory which is synced with container file system.
YB_SYNC_DIR: "target/universal/devspace-sync/"
YB_VERSION: "$(cat version.txt)"
GIT_LATEST_TAG: "$(git describe --tags --abbrev=0)"
YB_IMAGE_TAG:
source: env
default: "${GIT_LATEST_TAG}"
YBA_LOG_LEVEL: "DEBUG"