Skip to content

Commit

Permalink
Upgrade circle to v2
Browse files Browse the repository at this point in the history
Circle is sunsetting circle v1 this summer. This upgrades us to v2 so CI
will still work
  • Loading branch information
jmhooper committed Mar 22, 2018
1 parent 481aa4c commit e37f61e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:8-browsers
environment:
POSTGRES_USER: postgres
- image: circleci/postgres:9.5-alpine
environment:
POSTGRES_DB: analytics_reporter_test
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run:
name: install dependencies
command: npm install
- save_cache:
paths:
- ./node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run:
name: run tests
command: npm test
- run:
name: deploy site
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
bin/deploy-ci.sh
fi
2 changes: 1 addition & 1 deletion bin/deploy-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

# Install CF
curl https://s3-us-west-1.amazonaws.com/cf-cli-releases/releases/v6.25.0/cf-cli_6.25.0_linux_x86-64.tgz | tar xzvf -
mv cf /home/ubuntu/bin/cf
sudo mv cf /usr/local/bin/cf

# Log into cloud.gov
cf api api.fr.cloud.gov
Expand Down
8 changes: 0 additions & 8 deletions circle.yml

This file was deleted.

3 changes: 2 additions & 1 deletion knexfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ module.exports = {
test: {
client: 'postgresql',
connection: {
database: process.env.CIRCLECI ? "circle_test" : "analytics_reporter_test",
database: "analytics_reporter_test",
user: process.env.CIRCLECI ? "postgres" : config.postgres.user
},
migrations: {
tableName: 'knex_migrations',
Expand Down
2 changes: 1 addition & 1 deletion test/support/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const knex = require("knex")

const connection = {
host: process.env.PG_HOST ? process.env.PG_HOST : "localhost",
database: process.env.CIRCLECI ? "circle_test" : "analytics_reporter_test",
database: "analytics_reporter_test",
user : process.env.PG_USER ? process.env.PG_USER : 'postgres'
}

Expand Down

0 comments on commit e37f61e

Please sign in to comment.