-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CI and cloud.gov config to build with CircleCI #1253
Closed
Closed
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
fb1c53f
first try for migration
LindsayYoung a26905f
Remove travis references
LindsayYoung c57c67e
remove extra -r
LindsayYoung 28a808c
all requirements are in the same place here
LindsayYoung 8657433
Removing code that is erroring but I might need to add that directory…
LindsayYoung fb75373
Looks like nvm shoudl be in the linux build
LindsayYoung 96b1a26
Trying to get nvm in order
LindsayYoung e8c535b
Moving the build steps to the deploy, that should have the environmen…
LindsayYoung 480f716
Trying to get NVM working like it does on calc
LindsayYoung b709c5c
NVM loading still working no npm install
LindsayYoung 14bbfb5
Trying to get npm installs
LindsayYoung 8bb72b4
Remove paste error
LindsayYoung 8d4195d
remove typo
LindsayYoung 8a96139
working on env in tests
LindsayYoung c4038a0
trying to get test going
LindsayYoung 4cb13f4
new shell session, need to get to the right dir
LindsayYoung 58f6d07
Use environment
LindsayYoung 24495ea
Merge branch 'develop' into feature/move-to-circle
ccostino 1d7278e
Updated CircleCI config and other items
ccostino 4c606d3
Added DATABASE_URL environment variable
ccostino e659431
Removed extraneous file from cache key
ccostino af89ca9
Switched test DB name, updated README.md and Python runtime version
ccostino 0487cbf
Removed unused environment variable
ccostino 5dd7ed6
Updated nvm version
ccostino 061fce1
Fixed cache key names for consistency
ccostino 4f598ee
Fixed deploy command
ccostino 8650fdd
Add extra deploy steps back in - looks like they might be needed
ccostino 6ed00ac
Removed the .python-version file (see PR notes)
ccostino 8906912
Fixed search indexing tests
ccostino 7d06130
Force setting of locale in Python to ensure proper configuration
ccostino 012c6d1
Trying a different locale configuration line
ccostino 831c287
Remove all locale settings as they are breaking things in CI
ccostino 7032ba5
Trying to set locale in the container itself
ccostino 48512ab
Trying to explicitly set locale again in Python side
ccostino 3eaab99
Remove locale reset line in test
ccostino a38aca1
Explicitly setting locale in Django settings
ccostino d6fc212
Trying locale in the failing test itself
ccostino 0e530d6
Removing currency test for now due to locale issues
ccostino eb97cb2
Fixing codecov/coverage setup
ccostino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# Python CircleCI 2.0 configuration file | ||
# Check https://circleci.com/docs/2.0/language-python/ for more details | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
# CircleCI maintains a library of pre-built images documented at | ||
# https://circleci.com/docs/2.0/circleci-images/ | ||
# use `-browsers` prefix for selenium tests, e.g. `<image_name>-browsers` | ||
|
||
# Python | ||
- image: circleci/python:3.5.3 | ||
environment: | ||
TZ: America/New_York | ||
DATABASE_URL: postgres://[email protected]/cfdm_cms_test | ||
|
||
# PostgreSQL | ||
- image: circleci/postgres:9.6.2 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: cfdm_cms_test | ||
|
||
working_directory: ~/repo | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: Install system dependencies | ||
# Commands listed here are from the CircleCI PostgreSQL config docs: | ||
# https://circleci.com/docs/2.0/postgres-config/#postgresql-circleci-configuration-example | ||
command: | | ||
sudo apt-get install postgresql-client | ||
echo ‘/usr/lib/postgresql/9.6/bin/:$PATH’ >> $BASH_ENV | ||
echo "en_US.UTF-8 UTF-8" | sudo tee /etc/locale.gen | ||
sudo locale-gen en_US.UTF-8 | ||
|
||
- restore_cache: | ||
keys: | ||
- fec-cms-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "package.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- fec-cms-dependencies- | ||
|
||
- run: | ||
name: Install python dependencies | ||
command: | | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip install -U pip setuptools wheel codecov | ||
pip install -r requirements.txt | ||
|
||
- run: | ||
name: Install node dependencies | ||
command: | | ||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash | ||
echo ". ~/.nvm/nvm.sh" >> $BASH_ENV | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
nvm install 8.5.0 | ||
nvm use 8.5.0 | ||
nvm alias default 8.5.0 | ||
npm i -g npm webpack | ||
npm install | ||
npm run build | ||
cd fec | ||
webpack --optimize-minimize --define process.env.NODE_ENV="'production'" | ||
|
||
- save_cache: | ||
paths: | ||
- ./venv | ||
- ./node_modules | ||
key: fec-cms-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "package.json" }} | ||
|
||
- run: | ||
name: Ensure database is available | ||
command: dockerize -wait tcp://localhost:5432 -timeout 1m | ||
|
||
- run: | ||
name: Run tests | ||
command: | | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
. venv/bin/activate | ||
nvm use default | ||
cd fec | ||
./manage.py test | ||
npm run test-single | ||
|
||
- run: | ||
name: Perform post-test checks | ||
command: | | ||
. venv/bin/activate | ||
codecov | ||
|
||
- store_artifacts: | ||
path: test-reports | ||
destination: test-reports | ||
|
||
- run: | ||
name: Installs for deploy | ||
command: | | ||
mkdir -p $HOME/bin | ||
export PATH=$HOME/bin:$PATH | ||
curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&version=6.31.0" | tar xzv -C $HOME/bin | ||
cf install-plugin autopilot -f -r CF-Community | ||
|
||
|
||
- deploy: | ||
name: Deploy CMS | ||
command: | | ||
export PATH=$HOME/bin:$PATH | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
. venv/bin/activate | ||
nvm use default | ||
npm run build | ||
cd fec | ||
DJANGO_SETTINGS_MODULE='fec.settings.production' python manage.py collectstatic --noinput -v 0 | ||
DJANGO_SETTINGS_MODULE='fec.settings.production' python manage.py compress -v 0 | ||
cd .. | ||
pip install -r requirements.txt | ||
invoke deploy --branch $CIRCLE_BRANCH --login True --yes |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import locale | ||
import os | ||
|
||
import dj_database_url | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,7 @@ | |
] | ||
}, | ||
"engines": { | ||
"node": "5.5.0", | ||
"npm": "3.3.12" | ||
"node": "8.5.0", | ||
"npm": "5.4.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
python-3.5.3 | ||
python-3.5.4 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xtine should this kick back up one directory before running the tests with
npm
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm tasks still run without being in the root directory.