File tree Expand file tree Collapse file tree 4 files changed +56
-22
lines changed Expand file tree Collapse file tree 4 files changed +56
-22
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,22 @@ jobs:
35
35
command : |
36
36
sed -i 's@name: analytics-reporter-api@name: analytics-reporter-api-develop@g' manifest.yml
37
37
sed -i 's@- analytics-reporter-database@- analytics-reporter-database-develop@g' manifest.yml
38
- cat manifest.yml
39
38
- run :
40
39
name : Run sed on entrypoint.sh when deploying to develop
41
40
command : |
42
41
sed -i 's@NEW_RELIC_APP_NAME="analytics-reporter-api"@NEW_RELIC_APP_NAME="analytics-reporter-api-develop"@g' entrypoint.sh
43
42
43
+ - run :
44
+ name : Delete Knewfile.js and drop sufffix on Knexfile.js.cloudgov
45
+ command : |
46
+ rm knexfile.js
47
+ mv knexfile.js.cloudgov knexfile.js
48
+
44
49
- run :
45
50
name : Install CF CLI
46
51
command : |
47
- sudo wget --user-agent "Mozilla" -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - && sudo echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list && sudo apt-get update && sudo apt-get -y install cf8-cli curl
52
+ sudo curl -v -L -o cf8-cli-installer_8.7.4_x86-64.deb 'https://packages.cloudfoundry.org/stable?release=debian64&version=8.7.4'
53
+ sudo dpkg -i cf8-cli-installer_8.7.4_x86-64.deb
48
54
49
55
- run :
50
56
name : deploy
53
59
# Log into cloud.gov
54
60
cf api api.fr.cloud.gov
55
61
cf login -u $CF_USERNAME_DEV -p $CF_PASSWORD_DEV -o gsa-opp-analytics -s analytics-dev
56
- pwd
57
- ls -l
58
62
cat manifest.yml
59
63
cf push -f "./manifest.yml"
60
64
cf logout
Original file line number Diff line number Diff line change 1
- #! /bin/sh
2
- # Set Postgres env vars from VCAP_SERVICES
3
- export POSTGRES_DATABASE=$( echo $VCAP_SERVICES | jq -r ' ."aws-rds"[].credentials.db_name' )
4
- export POSTGRES_HOST=$( echo $VCAP_SERVICES | jq -r ' ."aws-rds"[].credentials.host' )
5
- export POSTGRES_PASSWORD=$( echo $VCAP_SERVICES | jq -r ' ."aws-rds"[].credentials.password' )
6
- export POSTGRES_USER=$( echo $VCAP_SERVICES | jq -r ' ."aws-rds"[].credentials.username' )
7
-
8
-
9
- # This line will get sed replaced based on the environment/branch
1
+ #! /bin/bash
10
2
export NEW_RELIC_APP_NAME=" analytics-reporter-api"
11
3
export NODE_ENV=" test"
4
+ export PATH=" $PATH :/home/vcap/deps/0/bin"
5
+ node deploy/cron.js
6
+
Original file line number Diff line number Diff line change
1
+ module.exports = {
2
+ development: {
3
+ client: 'postgresql',
4
+ connection: {
5
+ database: 'analytics-reporter'
6
+ }
7
+ },
8
+ production: {
9
+ client: 'postgresql',
10
+ connection: {
11
+ host : VCAP_SERVICES_JSON["aws-rds"][0]["credentials"]["host"],
12
+ user : VCAP_SERVICES_JSON["aws-rds"][0]["credentials"]["username"],
13
+ password : VCAP_SERVICES_JSON["aws-rds"][0]["credentials"]["password"],
14
+ database : VCAP_SERVICES_JSON["aws-rds"][0]["credentials"]["db_name"],
15
+
16
+ },
17
+ pool: {
18
+ min: 2,
19
+ max: 10
20
+ },
21
+ migrations: {
22
+ tableName: 'knex_migrations'
23
+ }
24
+ },
25
+ test: {
26
+ client: 'postgresql',
27
+ connection: {
28
+ user: process.env.CIRCLECI ? 'postgres' : undefined,
29
+ database: 'analytics-api-test'
30
+ },
31
+ migrations: {
32
+ tableName: 'knex_migrations'
33
+ }
34
+ }
35
+ };
Original file line number Diff line number Diff line change 1
- ---
2
1
applications :
3
- - name : analytics-reporter-api
4
- buildpack : https://github.com/cloudfoundry/nodejs-buildpack
5
- memory : 128M
6
- instances : 2
7
- command : " chmod +x ./entrypoint.sh && ./entrypoint.sh && npm start"
8
- services :
9
- - analytics-reporter-database
10
- stack : cflinuxfs4
2
+ - name : analytics-reporter-api
3
+ instances : 1
4
+ memory : 128M
5
+ buildpacks :
6
+ - nodejs_buildpack
7
+ command : " chmod +x ./entrypoint.sh && ./entrypoint.sh"
8
+ services :
9
+ - analytics-reporter-database
10
+ stack : cflinuxfs4
You can’t perform that action at this time.
0 commit comments