-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Tilt environment for easier testing
- Loading branch information
Showing
7 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# -*- mode: Python -*- | ||
|
||
kubectl_cmd = "kubectl" | ||
|
||
# verify kubectl command exists | ||
if str(local("command -v " + kubectl_cmd + " || true", quiet = True)) == "": | ||
fail("Required command '" + kubectl_cmd + "' not found in PATH") | ||
|
||
load('ext://namespace', 'namespace_yaml') | ||
k8s_yaml(namespace_yaml('external-secrets'), allow_duplicates=True) | ||
install = helm('deploy', namespace = 'external-secrets', set = 'image.tls.enabled=False') | ||
|
||
# Apply the updated yaml to the cluster. | ||
k8s_yaml(install, allow_duplicates = True) | ||
|
||
load('ext://restart_process', 'docker_build_with_restart') | ||
|
||
# enable hot reloading by doing the following: | ||
# - locally build the whole project | ||
# - create a docker imagine using tilt's hot-swap wrapper | ||
# - push that container to the local tilt registry | ||
local_resource( | ||
'external-secret-binary', | ||
"CC=x86_64-linux-musl-gcc GOOS=linux GOARCH=amd64 CGO_LDFLAGS='-lm' CGO_ENABLED=1 go build -ldflags '-linkmode external -extldflags -static' -o bin/bitwarden-sdk-server main.go", | ||
deps = [ | ||
"main.go", | ||
"go.mod", | ||
"go.sum", | ||
"cmd", | ||
"pkg", | ||
], | ||
) | ||
|
||
|
||
# Build the docker image for our controller. We use a specific Dockerfile | ||
# since tilt can't run on a scratch container. | ||
# `only` here is important, otherwise, the container will get updated | ||
# on _any_ file change. We only want to monitor the binary. | ||
# If debugging is enabled, we switch to a different docker file using | ||
# the delve port. | ||
entrypoint = ['/bitwarden-sdk-server', 'serve'] | ||
dockerfile = 'tilt.dockerfile' | ||
docker_build_with_restart( | ||
'ghcr.io/external-secrets/bitwarden-sdk-server', | ||
'.', | ||
dockerfile = dockerfile, | ||
entrypoint = entrypoint, | ||
only=[ | ||
'./bin', | ||
], | ||
live_update = [ | ||
sync('./bin/bitwarden-sdk-server', '/bitwarden-sdk-server'), | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM alpine@sha256:77726ef6b57ddf65bb551896826ec38bc3e53f75cdde31354fbffb4f25238ebd | ||
WORKDIR / | ||
COPY ./bin/bitwarden-sdk-server /bitwarden-sdk-server | ||
|
||
ENV CGO_ENABLED=1 | ||
ENV BW_SECRETS_MANAGER_STATE_PATH='/state' | ||
ENTRYPOINT ["/bitwarden-sdk-server", "serve", "--insecure"] |