File tree 5 files changed +66
-38
lines changed
5 files changed +66
-38
lines changed Original file line number Diff line number Diff line change 15
15
16
16
# misc
17
17
.DS_Store
18
+ .env
18
19
.env.local
19
20
.env.development.local
20
21
.env.test.local
Original file line number Diff line number Diff line change @@ -18,11 +18,19 @@ all: test
18
18
19
19
ci : test $(DEPLOY_TARGET )
20
20
21
+ # Run the ci target as if we were on Travis CI
22
+ fake_ci : .env
23
+ CI=true \
24
+ TRAVIS_COMMIT=` git rev-parse --short HEAD` +` date +%s` \
25
+ TRAVIS_BRANCH=` git rev-parse --abbrev-ref HEAD` \
26
+ REACT_APP_API_BASE_URL=http://localhost:8080 \
27
+ make ci
28
+
21
29
# # =====================
22
30
# # Build/test tasks
23
31
# # =====================
24
32
25
- test :
33
+ test : .env
26
34
npm run test:pact
27
35
28
36
# # =====================
@@ -34,8 +42,9 @@ deploy: can_i_deploy deploy_app tag_as_prod
34
42
no_deploy :
35
43
@echo " Not deploying as not on master branch"
36
44
37
- can_i_deploy :
45
+ can_i_deploy : .env
38
46
@docker run --rm \
47
+ --env-file .env \
39
48
-e PACT_BROKER_BASE_URL \
40
49
-e PACT_BROKER_TOKEN \
41
50
pactfoundation/pact-cli:latest \
@@ -49,8 +58,9 @@ can_i_deploy:
49
58
deploy_app :
50
59
@echo " Deploying to prod"
51
60
52
- tag_as_prod :
61
+ tag_as_prod : .env
53
62
@docker run --rm \
63
+ --env-file .env \
54
64
-e PACT_BROKER_BASE_URL \
55
65
-e PACT_BROKER_TOKEN \
56
66
pactfoundation/pact-cli:latest \
@@ -105,3 +115,7 @@ travis_login:
105
115
# Requires PACT_BROKER_TOKEN to be set
106
116
travis_encrypt_pact_broker_token :
107
117
@docker run --rm -v ${HOME} /.travis:/root/.travis -v ${PWD} :${PWD} --workdir ${PWD} lirantal/travis-cli encrypt --pro PACT_BROKER_TOKEN=" ${PACT_BROKER_TOKEN} "
118
+
119
+
120
+ .env :
121
+ touch .env
Original file line number Diff line number Diff line change 49
49
"eslint-plugin-jsx-a11y" : " ^6.2.3" ,
50
50
"eslint-plugin-react" : " ^7.17.0" ,
51
51
"eslint-plugin-react-hooks" : " ^1.7.0" ,
52
- "nock" : " ^11.7.2"
52
+ "nock" : " ^11.7.2" ,
53
+ "dotenv" : " ^8.2.0"
53
54
}
54
55
}
Original file line number Diff line number Diff line change
1
+ require ( 'dotenv' ) . config ( )
1
2
const pact = require ( '@pact-foundation/pact-node' ) ;
2
3
3
4
if ( process . env . CI !== 'true' ) {
You can’t perform that action at this time.
0 commit comments