Skip to content

Commit ead900c

Browse files
authored
feat(dev): add initial Skaffold configuration for local development (#331)
## 📝 Description - Introduced `skaffold.yaml` to support local development with live sync and custom builds per service. - Integrated Skaffold support into Makefile via `build.skaffold` target. - Enabled selective file syncing for the front-end service to support live reload. - Applied `DOCKER_BUILD_TARGET=dev` and `MIX_ENV=prod` for compatibility with existing setup. - Added Helm overrides for writable root filesystem and internal TLS skip in local clusters. ## ✅ Checklist - [x] I have tested this change - [ ] This change requires documentation update
1 parent 80149eb commit ead900c

File tree

2 files changed

+147
-4
lines changed

2 files changed

+147
-4
lines changed

Makefile

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ ifeq ($(BUILD_ENV),)
3030
endif
3131

3232
IMAGE_TAG=$(BUILD_ENV)
33-
DOCKER_BUILD_TARGET=runner
3433
ifneq ($(BUILD_ENV),prod)
35-
DOCKER_BUILD_TARGET=dev
34+
DOCKER_BUILD_TARGET?=dev
35+
else
36+
DOCKER_BUILD_TARGET?=runner
3637
endif
3738

3839
#
@@ -63,9 +64,10 @@ BUILDKIT_INLINE_CACHE=1
6364
#
6465
# Using tty progress output makes our job logs difficult to read
6566
#
66-
DOCKER_BUILD_PROGRESS=plain
6767
ifeq ($(CI),)
68-
DOCKER_BUILD_PROGRESS=tty
68+
DOCKER_BUILD_PROGRESS?=tty
69+
else
70+
DOCKER_BUILD_PROGRESS?=plain
6971
endif
7072

7173
DOCKER_BUILD_PATH=.
@@ -178,6 +180,20 @@ else
178180
$(DOCKER_BUILD_PATH)
179181
endif
180182

183+
build.skaffold: DOCKER_BUILD_PROGRESS=plain
184+
build.skaffold: pull
185+
ifneq ($(MIX_ENV),)
186+
mkdir -p deps _build
187+
endif
188+
docker build -f Dockerfile \
189+
--target $(DOCKER_BUILD_TARGET) \
190+
--progress $(DOCKER_BUILD_PROGRESS) \
191+
--build-arg BUILDKIT_INLINE_CACHE=$(BUILDKIT_INLINE_CACHE) \
192+
--build-arg APP_NAME=$(APP_NAME) \
193+
--build-arg BUILD_ENV=$(BUILD_ENV) \
194+
-t $(IMAGE) \
195+
$(DOCKER_BUILD_PATH)
196+
181197
#
182198
# Development operations
183199
#

skaffold.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
apiVersion: skaffold/v4beta12
2+
kind: Config
3+
metadata:
4+
name: semaphore
5+
build:
6+
local: {}
7+
artifacts:
8+
- image: ghcr.io/semaphoreio/github_hooks
9+
custom:
10+
buildCommand: "APP_ENV=prod make build.skaffold"
11+
context: github_hooks
12+
- image: ghcr.io/semaphoreio/auth
13+
custom:
14+
buildCommand: "MIX_ENV=prod make build.skaffold"
15+
context: auth
16+
- image: ghcr.io/semaphoreio/guard
17+
custom:
18+
buildCommand: "MIX_ENV=prod make build.skaffold"
19+
context: guard
20+
- image: ghcr.io/semaphoreio/badges
21+
custom:
22+
buildCommand: "MIX_ENV=prod make build.skaffold"
23+
context: badge
24+
- image: ghcr.io/semaphoreio/front
25+
context: front
26+
custom:
27+
buildCommand: "DOCKER_BUILD_TARGET=dev MIX_ENV=prod make build.skaffold"
28+
sync:
29+
manual:
30+
- src: 'lib/**/*'
31+
dest: /app
32+
- src: 'config/**/*.exs'
33+
dest: /app
34+
- image: ghcr.io/semaphoreio/ppl
35+
custom:
36+
buildCommand: "MIX_ENV=prod make build.skaffold"
37+
context: plumber/ppl
38+
- image: ghcr.io/semaphoreio/projecthub-grpc
39+
custom:
40+
buildCommand: "MIX_ENV=prod make build.skaffold"
41+
context: projecthub
42+
- image: ghcr.io/semaphoreio/projecthub-rest-api
43+
custom:
44+
buildCommand: "MIX_ENV=prod make build.skaffold"
45+
context: projecthub-rest-api
46+
- image: ghcr.io/semaphoreio/secrethub
47+
custom:
48+
buildCommand: "MIX_ENV=prod make build.skaffold"
49+
context: secrethub
50+
- image: ghcr.io/semaphoreio/notifications
51+
custom:
52+
buildCommand: "MIX_ENV=prod make build.skaffold"
53+
context: notifications
54+
- image: ghcr.io/semaphoreio/zebra
55+
custom:
56+
buildCommand: "MIX_ENV=prod make build.skaffold"
57+
context: zebra
58+
- image: ghcr.io/semaphoreio/periodic-scheduler
59+
custom:
60+
buildCommand: "MIX_ENV=prod make build.skaffold"
61+
context: periodic_scheduler/scheduler
62+
- image: ghcr.io/semaphoreio/dashboardhub
63+
custom:
64+
buildCommand: "MIX_ENV=prod make build.skaffold"
65+
context: dashboardhub
66+
- image: ghcr.io/semaphoreio/github_notifier
67+
custom:
68+
buildCommand: "MIX_ENV=prod make build.skaffold"
69+
context: github_notifier
70+
- image: ghcr.io/semaphoreio/branch_hub
71+
custom:
72+
buildCommand: "MIX_ENV=prod make build.skaffold"
73+
context: branch_hub
74+
- image: ghcr.io/semaphoreio/public_api
75+
custom:
76+
buildCommand: "MIX_ENV=prod make build.skaffold"
77+
context: public-api/v2
78+
- image: ghcr.io/semaphoreio/plumber-public
79+
custom:
80+
buildCommand: "MIX_ENV=prod make build.skaffold"
81+
context: public-api/v1alpha
82+
- image: ghcr.io/semaphoreio/bootstrapper
83+
custom:
84+
buildCommand: "APP_ENV=prod make build.skaffold"
85+
context: bootstrapper
86+
- image: ghcr.io/semaphoreio/artifacthub
87+
custom:
88+
buildCommand: "APP_ENV=prod make build.skaffold"
89+
context: artifacthub
90+
- image: ghcr.io/semaphoreio/repository_hub
91+
custom:
92+
buildCommand: "MIX_ENV=prod make build.skaffold"
93+
context: repository_hub
94+
- image: ghcr.io/semaphoreio/scouter
95+
custom:
96+
buildCommand: "MIX_ENV=prod make build.skaffold"
97+
context: scouter
98+
- image: ghcr.io/semaphoreio/keycloak-setup
99+
custom:
100+
buildCommand: "APP_ENV=prod make build.skaffold"
101+
context: keycloak/setup
102+
- image: ghcr.io/semaphoreio/keycloak
103+
custom:
104+
buildCommand: "APP_ENV=prod make build.skaffold"
105+
context: keycloak/image
106+
deploy:
107+
helm:
108+
releases:
109+
- name: semaphore
110+
chartPath: helm-chart
111+
valuesFiles:
112+
- helm-chart/values.yaml
113+
setValues:
114+
global.development.writableRootFilesystem: true
115+
global.development.skipTlsVerifyInternal: true # false if cert is not self signed
116+
global.domain.name: ""
117+
global.domain.ip: "" # minikube ip
118+
global.rootUser.email: ""
119+
global.organization.name: ""
120+
ingress.className: "nginx"
121+
ingress.ssl.type: "custom"
122+
ingress.ssl.crt: "" # use mkcert '*.semaphore.localhost' and later cat _wildcard.semaphore.localhost.pem | base64 -w 0
123+
ingress.ssl.key: "" # cat _wildcard.semaphore.localhost-key.pem | base64 -w 0
124+
version: 0.1.0
125+
flags:
126+
upgrade: ["--timeout", "120m"]
127+
install: ["--timeout", "120m"]

0 commit comments

Comments
 (0)