forked from CircleCI-Public/circleci-demo-javascript-express
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request CircleCI-Public#5 from levlaz/wf"
- Loading branch information
Showing
8 changed files
with
35 additions
and
13,904 deletions.
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 |
---|---|---|
@@ -1,102 +1,35 @@ | ||
defaults: &defaults | ||
working_directory: ~/mern-starter | ||
docker: | ||
- image: node:8.3 | ||
- image: mongo:3.4.7 | ||
|
||
version: 2 | ||
jobs: | ||
build: | ||
<<: *defaults | ||
working_directory: ~/mern-starter | ||
docker: | ||
- image: circleci/node:4.8.2 | ||
- image: mongo:3.4.4 | ||
steps: | ||
- checkout | ||
- run: | ||
name: update-npm | ||
command: 'sudo npm install -g npm@latest' | ||
- restore_cache: | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
- run: | ||
name: install dependencies | ||
name: install-npm-wee | ||
command: npm install | ||
- save_cache: | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
paths: | ||
- ./node_modules | ||
- run: | ||
name: make test results folder | ||
command: mkdir test_results | ||
- persist_to_workspace: | ||
root: /root | ||
paths: | ||
- mern-starter | ||
|
||
test: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: /root | ||
|
||
- run: | ||
command: | | ||
ls -al | ||
ls -al /root/mern-starter | ||
- run: | ||
name: test | ||
command: npm test | ||
- run: | ||
name: code-coverage | ||
command: './node_modules/.bin/nyc report --reporter=text-lcov' | ||
- store_artifacts: | ||
path: test_results | ||
path: test-results.xml | ||
prefix: tests | ||
- store_artifacts: | ||
path: coverage | ||
prefix: coverage | ||
- store_test_results: | ||
path: test_results | ||
|
||
create_docker: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: /root | ||
- setup_remote_docker | ||
- run: | ||
name: Build and Push Docker Image | ||
command: | | ||
docker build -t levlaz/circleci-demo-js-express . | ||
docker tag levlaz/circleci-demo-js-express:$CIRCLE_SHA1 levlaz/circleci-demo-js-express:stable | ||
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS | ||
docker push levlaz/circleci-demo-js-express | ||
deploy: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: /root | ||
- run: | ||
name: deploy to AWS | ||
command: | | ||
./script/deploy.sh | ||
workflows: | ||
version: 2 | ||
|
||
btd: | ||
jobs: | ||
- build | ||
- test: | ||
requires: | ||
- build | ||
- create_docker: | ||
requires: | ||
- test | ||
filters: | ||
branches: | ||
only: | ||
- prod | ||
- deploy: | ||
requires: | ||
- create_docker | ||
filters: | ||
branches: | ||
only: | ||
- prod | ||
path: test-results.xml |
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 |
---|---|---|
|
@@ -8,5 +8,3 @@ public/* | |
dist | ||
coverage/ | ||
.nyc_output/ | ||
*.swp | ||
test-results.xml |
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,4 +1,5 @@ | ||
FROM node:8.3.0 | ||
FROM node | ||
MAINTAINER jaga santagostino <[email protected]> | ||
|
||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
@@ -8,8 +9,7 @@ RUN npm install | |
COPY . /usr/src/app | ||
|
||
ENV NODE_ENV production | ||
RUN npm run clean && npm run build && npm run build:server | ||
|
||
EXPOSE 8000 | ||
CMD ["npm", "run", "start:prod"] | ||
CMD ["npm", "run", "bs"] | ||
|
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,15 +1,16 @@ | ||
version: '2' | ||
|
||
services: | ||
app: | ||
image: levlaz/circleci-demo-js-express:stable | ||
ports: | ||
- "80:8000" | ||
environment: | ||
NODE_ENV: production | ||
MONGO_URL: mongodb://db:27017/mern-starter | ||
db: | ||
image: mongo:3.2.11 | ||
ports: | ||
- "27017:27017" | ||
web: | ||
build: . | ||
links: | ||
- db | ||
ports: | ||
- "80:8000" | ||
volumes: | ||
- .:/usr/src/app/ | ||
environment: | ||
NODE_ENV: production | ||
MONGO_URL: mongodb://db:27017/mern-starter | ||
db: | ||
image: mongo:latest | ||
ports: | ||
- "27017:27017" | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.