Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
apricot13 committed Jun 12, 2024
1 parent 7c9bc60 commit 5ea1c8c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/test-in-herokuish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ jobs:
context: .
tags: ghcr.io/wearefuturegov/outpost:test
file: Dockerfile.test
# load: true
push: true
load: true
# push: true
build-args: |
NODE_OPTIONS=--openssl-legacy-provider
RAILS_ENV=test
Expand All @@ -98,22 +98,23 @@ jobs:
# run: |
# docker run --rm outpost:test

# - name: Run the image and tests
# run: |
# docker run -d --name test_container \
# --network $test_network_name \
# -p 3000:3000 \
# -e RAILS_ENV=test \
# -e NODE_ENV=development \
# -e RAILS_SERVE_STATIC_FILES=true \
# -e DB_URI=$test_mongo_internal_db_uri \
# -e DATABASE_URL=$test_postgres_internal_db_uri \
# -e GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }} \
# -e OFSTED_FEED_API_ENDPOINT=https://test-ofsted-feed.stub \
# outpost:test
# docker exec test_container /exec bin/bundle exec rspec

# docker exec temp_container /bin/herokuish procfile exec bin/bundle exec rails assets:precompile
- name: Run the image and tests
run: |
docker run --rm --name test_container \
--network $test_network_name \
-p 3000:3000 \
-e RAILS_ENV=test \
-e NODE_ENV=development \
-e RAILS_SERVE_STATIC_FILES=true \
-e DB_URI=$test_mongo_internal_db_uri \
-e DATABASE_URL=$test_postgres_internal_db_uri \
-e GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }} \
-e OFSTED_FEED_API_ENDPOINT=https://test-ofsted-feed.stub \
outpost:test
# docker exec test_container /exec bin/bundle exec rspec

# docker exec temp_container /bin/herokuish procfile exec bin/bundle exec rails assets:precompile

# @TODO fix static files not generating in this image
# name: Run tests in herokuish
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ ARG RAILS_ENV=test
# generate slug as app.tar.gz
# ------------
FROM --platform=linux/amd64 gliderlabs/herokuish:latest-${STACK_VERSION}
WORKDIR /tmp/app
COPY ./app.json /tmp
COPY . /tmp/app

ARG NODE_ENV
ARG RAILS_ENV
Expand All @@ -24,6 +23,9 @@ RUN (cat /tmp/app.json || echo '{}') | jq -r '.environments.test.buildpacks[].ur
RUN while IFS= read -r line; do herokuish buildpack install "$line"; done < /tmp/app/.buildpacks


RUN /build && \
rm -Rf /tmp/*


RUN apt-get update --error-on=any

Expand Down Expand Up @@ -88,5 +90,5 @@ RUN echo $RAILS_ENV
RUN echo $NODE_ENV
RUN echo $RAILS_SERVE_STATIC_FILES

ENTRYPOINT [ "/bin/herokuish" ]
CMD [ "buildpack", "test" ]
ENTRYPOINT [ "/exec" ]
CMD [ "bin/bundle", "exec", "rspec" ]

0 comments on commit 5ea1c8c

Please sign in to comment.