File tree 8 files changed +13904
-35
lines changed
8 files changed +13904
-35
lines changed Original file line number Diff line number Diff line change
1
+ defaults : &defaults
2
+ working_directory : ~/mern-starter
3
+ docker :
4
+ - image : node:8.3
5
+ - image : mongo:3.4.7
6
+
1
7
version : 2
2
8
jobs :
3
9
build :
4
- working_directory : ~/mern-starter
5
- docker :
6
- - image : circleci/node:4.8.2
7
- - image : mongo:3.4.4
10
+ << : *defaults
8
11
steps :
9
12
- checkout
10
- - run :
11
- name : update-npm
12
- command : ' sudo npm install -g npm@latest'
13
13
- restore_cache :
14
14
key : dependency-cache-{{ checksum "package.json" }}
15
15
- run :
16
- name : install-npm-wee
16
+ name : install dependencies
17
17
command : npm install
18
18
- save_cache :
19
19
key : dependency-cache-{{ checksum "package.json" }}
20
20
paths :
21
21
- ./node_modules
22
+ - run :
23
+ name : make test results folder
24
+ command : mkdir test_results
25
+ - persist_to_workspace :
26
+ root : /root
27
+ paths :
28
+ - mern-starter
29
+
30
+ test :
31
+ << : *defaults
32
+ steps :
33
+ - attach_workspace :
34
+ at : /root
35
+
36
+ - run :
37
+ command : |
38
+ ls -al
39
+ ls -al /root/mern-starter
22
40
- run :
23
41
name : test
24
42
command : npm test
25
43
- run :
26
44
name : code-coverage
27
45
command : ' ./node_modules/.bin/nyc report --reporter=text-lcov'
28
46
- store_artifacts :
29
- path : test-results.xml
30
- prefix : tests
47
+ path : test_results
31
48
- store_artifacts :
32
49
path : coverage
33
50
prefix : coverage
34
51
- store_test_results :
35
- path : test-results.xml
52
+ path : test_results
53
+
54
+ create_docker :
55
+ << : *defaults
56
+ steps :
57
+ - attach_workspace :
58
+ at : /root
59
+ - setup_remote_docker
60
+ - run :
61
+ name : Build and Push Docker Image
62
+ command : |
63
+ docker build -t levlaz/circleci-demo-js-express .
64
+ docker tag levlaz/circleci-demo-js-express:$CIRCLE_SHA1 levlaz/circleci-demo-js-express:stable
65
+ docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
66
+ docker push levlaz/circleci-demo-js-express
67
+
68
+ deploy :
69
+ << : *defaults
70
+ steps :
71
+ - attach_workspace :
72
+ at : /root
73
+ - run :
74
+ name : deploy to AWS
75
+ command : |
76
+ ./script/deploy.sh
77
+
78
+
79
+
80
+ workflows :
81
+ version : 2
82
+
83
+ btd :
84
+ jobs :
85
+ - build
86
+ - test :
87
+ requires :
88
+ - build
89
+ - create_docker :
90
+ requires :
91
+ - test
92
+ filters :
93
+ branches :
94
+ only :
95
+ - prod
96
+ - deploy :
97
+ requires :
98
+ - create_docker
99
+ filters :
100
+ branches :
101
+ only :
102
+ - prod
Original file line number Diff line number Diff line change 8
8
dist
9
9
coverage /
10
10
.nyc_output /
11
+ * .swp
12
+ test-results.xml
Original file line number Diff line number Diff line change 1
- FROM node
2
- MAINTAINER jaga santagostino <
[email protected] >
1
+ FROM node:8.3.0
3
2
4
3
RUN mkdir -p /usr/src/app
5
4
WORKDIR /usr/src/app
@@ -9,7 +8,8 @@ RUN npm install
9
8
COPY . /usr/src/app
10
9
11
10
ENV NODE_ENV production
11
+ RUN npm run clean && npm run build && npm run build:server
12
12
13
13
EXPOSE 8000
14
- CMD ["npm" , "run" , "bs " ]
14
+ CMD ["npm" , "run" , "start:prod " ]
15
15
Original file line number Diff line number Diff line change 1
- web :
2
- build : .
3
- links :
4
- - db
5
- ports :
6
- - " 80:8000"
7
- volumes :
8
- - .:/usr/src/app/
9
- environment :
10
- NODE_ENV : production
11
- MONGO_URL : mongodb://db:27017/mern-starter
12
- db :
13
- image : mongo:latest
14
- ports :
15
- - " 27017:27017"
1
+ version : ' 2'
2
+
3
+ services :
4
+ app :
5
+ image : levlaz/circleci-demo-js-express:stable
6
+ ports :
7
+ - " 80:8000"
8
+ environment :
9
+ NODE_ENV : production
10
+ MONGO_URL : mongodb://db:27017/mern-starter
11
+ db :
12
+ image : mongo:3.2.11
13
+ ports :
14
+ - " 27017:27017"
16
15
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <testsuite errors =" 0" failures =" 0" name =" test_api.APITestCase-20170713141358" skipped =" 0" tests =" 9" time =" 1.926" >
3
+ <testcase classname =" test_api.APITestCase" name =" test_404" time =" 0.202" />
4
+ <testcase classname =" test_api.APITestCase" name =" test_anonymous" time =" 0.190" />
5
+ <testcase classname =" test_api.APITestCase" name =" test_bad_auth" time =" 0.217" />
6
+ <testcase classname =" test_api.APITestCase" name =" test_comments" time =" 0.236" />
7
+ <testcase classname =" test_api.APITestCase" name =" test_no_auth" time =" 0.181" />
8
+ <testcase classname =" test_api.APITestCase" name =" test_posts" time =" 0.253" />
9
+ <testcase classname =" test_api.APITestCase" name =" test_token_auth" time =" 0.198" />
10
+ <testcase classname =" test_api.APITestCase" name =" test_unconfirmed_account" time =" 0.241" />
11
+ <testcase classname =" test_api.APITestCase" name =" test_users" time =" 0.209" />
12
+ <system-out >
13
+ <![CDATA[ ]]> </system-out >
14
+ <system-err >
15
+ <![CDATA[ ]]> </system-err >
16
+ </testsuite >
You can’t perform that action at this time.
0 commit comments