Skip to content

Commit

Permalink
Revert "Merge pull request CircleCI-Public#5 from levlaz/wf"
Browse files Browse the repository at this point in the history
This reverts commit ae56493, reversing
changes made to 17b15b5.
  • Loading branch information
levlaz committed Aug 16, 2017
1 parent ae56493 commit 0098152
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 13,904 deletions.
89 changes: 11 additions & 78 deletions .circleci/config.yml
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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ public/*
dist
coverage/
.nyc_output/
*.swp
test-results.xml
6 changes: 3 additions & 3 deletions Dockerfile
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
Expand All @@ -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"]

29 changes: 15 additions & 14 deletions docker-compose.yml
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"

16 changes: 0 additions & 16 deletions fake-results.xml

This file was deleted.

Loading

0 comments on commit 0098152

Please sign in to comment.