Skip to content

Commit

Permalink
Merge pull request #6 from synackd/use-env-vars
Browse files Browse the repository at this point in the history
Add environment variable for each flag
  • Loading branch information
alexlovelltroy authored Jan 19, 2024
2 parents 49d50d3 + 75ffe6f commit 19fab6a
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 113 deletions.
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ STOPSIGNAL SIGTERM

RUN apk add --no-cache tini

# Setup environment variables.
ENV HSM_URL=http://smd:27779
ENV NFD_URL=http://cray-hmnfd

# For cloud-init
ENV BSS_ADVERTISE_ADDRESS=localhost

# WARNING: Our containers currently do not have certificates set up correctly
# to allow for https connections to other containers. Therefore, we
# will use an insecure connection. This needs to be corrected before
# release. Once the certificates are properly set up, the --insecure
# option needs to be removed.
ENV BSS_OPTS="--insecure --postgres-insecure"
ENV BSS_INSECURE=true

ENV BSS_RETRY_DELAY=30
ENV BSS_HSM_RETRIEVAL_DELAY=10
Expand All @@ -58,13 +60,6 @@ COPY .version /
USER 65534:65534

# Set up the command to start the service.
CMD /usr/local/bin/boot-script-service $BSS_OPTS \
--cloud-init-address localhost \
--postgres \
--postgres-host $POSTGRES_HOST \
--postgres-port $POSTGRES_PORT \
--retry-delay=$BSS_RETRY_DELAY \
--hsm $HSM_URL \
--hsm-retrieval-delay=$BSS_HSM_RETRIEVAL_DELAY
CMD /usr/local/bin/boot-script-service

ENTRYPOINT ["/sbin/tini", "--"]
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@
# OTHER DEALINGS IN THE SOFTWARE.

# Service
NAME ?= cray-bss
NAME ?= bss
VERSION ?= $(shell cat .version)
BINARIES = boot-script-service


all : image unittest ct snyk ct_image

binaries: $(BINARIES)

%: cmd/%/*.go
GOOS=linux GOARCH=amd64 go build -v -tags musl $(LDFLAGS) -o $@ ./$(dir $<)

clean:
rm -f $(BINARIES)

image:
docker build ${NO_CACHE} --pull ${DOCKER_ARGS} --tag '${NAME}:${VERSION}' .

Expand All @@ -41,3 +50,6 @@ ct:

ct_image:
docker build --no-cache -f test/ct/Dockerfile test/ct/ --tag hms-bss-hmth-test:${VERSION}

docker: $(BINARIES)
docker build --tag openchami/bss:$(VERSION)-dirty .
Loading

0 comments on commit 19fab6a

Please sign in to comment.