Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
fix consul put to add file
Browse files Browse the repository at this point in the history
  • Loading branch information
darrylmendillo committed Mar 31, 2021
1 parent d9c2e0a commit e3b9d05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ RUN apt-get update && \
unzip

ADD entrypoint.sh /entrypoint.sh
ADD ./src/submit_to_consul.sh /scripts/submit_to_consul.sh

# install yq
# download yq and consul
RUN wget -qO /usr/bin/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_${BINARY} &&\
chmod +x /usr/bin/yq
wget -qO consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_${BINARY}.zip

# install consul
RUN wget -qO consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_${BINARY}.zip &&\
# install yq and consul
RUN chmod +x /usr/bin/yq &&\
unzip consul.zip -d /usr/local/bin/

ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ services:

consul:
build: .
entrypoint: /bin/bash
#entrypoint: /bin/bash
environment:
CONSUL_HTTP_ADDR: "http://10.145.240.242:8500"
DEPLOY_CONFIG: "local/deploy_config.yml"
ENV: "staging"
ENV: "production"
restart: always
stdin_open: true # docker run -i
stop_signal: SIGTERM
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ for SERVICE in $(echo $SERVICES | sed "s/,/ /g"); do
FILE_NAME=$(yq read $DEPLOY_CONFIG services.$SERVICE.configuration.name)

# submit to consul
consul kv put $ORGANIZATION/$PROJECT/$SERVICE/$FILE_NAME $CONFIG_FILE
consul kv put $ORGANIZATION/$PROJECT/$SERVICE/$FILE_NAME @$CONFIG_FILE

done

0 comments on commit e3b9d05

Please sign in to comment.