Skip to content

Commit

Permalink
Merge pull request #343 from NREL/deploy-fix
Browse files Browse the repository at this point in the history
cleanup deploy script
  • Loading branch information
nllong authored Jun 7, 2018
2 parents 23adce5 + 614d15f commit 4515f27
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ rubocop-results.xml
server-data
worker-data


# ignore files with ~ at end
*~
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

FROM nrel/openstudio:2.5.0
MAINTAINER Nicholas Long nicholas.long@nrel.gov
ARG rails_env=docker
ARG bundle_args="--without development test"

# Install required libaries
RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && \
Expand Down Expand Up @@ -71,6 +69,10 @@ ENV OPENSTUDIO_SERVER 'true'
ENV OS_RAYPATH /usr/Radiance
ENV PERL_EXE_PATH /usr/bin

# Specify a couple arguments here, after running the majority of the installation above
ARG rails_env=docker
ARG bundle_args="--without development test"

# Set the rails env var
ENV RAILS_ENV $rails_env
ENV GECKODRIVER_VERSION v0.15.0
Expand Down
6 changes: 4 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ test:
# - docker-compose stop
post:
- rsync -av reports/ $CIRCLE_ARTIFACTS/reports/
# Reset the git checkout to remove the test-based data in the containers and rebuild
# Rebuild the web container as the env var affects
- git checkout -- .dockerignore && git checkout -- Dockerfile
- docker-compose -f docker-compose.test.yml build --build-arg rails_env=docker --build-arg bundle_args="--without development test" web

deployment:
production:
branch: [develop, master, nrcan-master]
commands:
- git checkout -- .dockerignore && git checkout -- Dockerfile
- docker-compose build --pull
- source docker/deployment/scripts/circle_deployment.sh
2 changes: 1 addition & 1 deletion docker/deployment/scripts/circle_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

if [ "${IMAGETAG}" != "skip" ] && [ -z ${CI_PULL_REQUEST} ]; then
# If CI_PULL_REQUEST is set, then the -z returns false (counter-intuitive)
docker-compose build --pull

# Still need email with circleci, presumably because of the version of docker.
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS

Expand Down

0 comments on commit 4515f27

Please sign in to comment.