Skip to content

Commit

Permalink
Move some postgres setup commands into the docker image (mobilecoinfo…
Browse files Browse the repository at this point in the history
…undation#667)

This reduces the number of commands someone has to do from `./mob prompt`
to just `service postgresql start` in order to be able to run `cargo test`.
This will also mean we don't need to put those commands in circle-ci config.
  • Loading branch information
cbeck88 authored Dec 21, 2020
1 parent e2b038f commit f95741c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
version: 2.1

defaults:
builder-install: &builder-install gcr.io/mobilenode-211420/builder-install:1_14
builder-install: &builder-install gcr.io/mobilenode-211420/builder-install:1_15
default-xcode-version: &default-xcode-version "12.0.0"

default-environment: &default-environment
Expand Down
10 changes: 10 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ ARG DOCKER_NO_SGX=false
COPY --chown=root:root install_sgx.sh /tmp
RUN if [ "$DOCKER_NO_SGX" = "false" ] ; then cd /tmp && chmod +x install_sgx.sh && ./install_sgx.sh; else echo 'skipping sgx'; fi

# Setup postgresql for local testing
RUN sed -ie 's|host all all 127.0.0.1/32 md5|host all all 127.0.0.1/32 trust|' /etc/postgresql/10/main/pg_hba.conf && \
sed -ie 's|host all all ::1/128 md5|host all all ::1/128 trust|' /etc/postgresql/10/main/pg_hba.conf && \
service postgresql start && \
su postgres -c "createuser --superuser root"

# Export postgres database url's for build environment, for local testing and conformance tests
ENV DATABASE_URL="postgres://localhost"
ENV TEST_DATABASE_URL="postgres://localhost"

# Export sgx sdk environment variables
# Doing this here means that we don't have to constantly source /opt/intel/sgxsdk/environment
# Docker doesn't appear to allow conditional ENV setting, but if DOCKER_NO_SGX is true then they won't use any of this I think
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1_14
1_15
2 changes: 1 addition & 1 deletion jenkins/build-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
topologyKey: "kubernetes.io/hostname"
containers:
- name: rust-builder-default
image: gcr.io/mobilenode-211420/builder-install:1_14
image: gcr.io/mobilenode-211420/builder-install:1_15
env:
- name: PATH
value: "/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/intel/sgxsdk/bin:/opt/intel/sgxsdk/bin/x64"
Expand Down

0 comments on commit f95741c

Please sign in to comment.