Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.74 KB | None | 0 0
  1. version: 2.1
  2. orbs:
  3.   codecov: codecov/codecov@1.0.4
  4.  
  5. jobs: # here we define two jobs: \"build\" and \"test\"
  6.   build:
  7.     working_directory: ~/simpleServer
  8.     docker:
  9.       - image: circleci/node:10
  10.     steps:
  11.      - checkout
  12.       - run:
  13.           name: Install Dependencies
  14.           command: npm install
  15.       - run:
  16.           name: Build Application
  17.           command: npm run build:js
  18.       - run: mkdir dist
  19.       - persist_to_workspace:
  20.           root: dist
  21.           paths:
  22.             - ./
  23.   test:
  24.     environment:
  25.       NODE_ENV: test
  26.       JWT_SECRET: secret
  27.       JWT_EXPIRES_IN: 90d
  28.       JWT_COOKIE_EXPIRES_IN: 90
  29.       MONGOSTRING: "mongodb://localhost:27017/test"
  30.       MYSQL_ROOT_PASSWORD: ""
  31.       MYSQL_ALLOW_EMPTY_PASSWORD: true
  32.       MYSQL_DATABASE: circle_test
  33.       MYSQL_USER: root
  34.       MYSQL_PASSWORD: ""
  35.     working_directory: ~/simpleServer
  36.     docker:
  37.       - image: circleci/node:10
  38.       - image: gmaster0o0/circlecimysql:v1
  39.       - image: circleci/mongo:latest
  40.     steps:
  41.      - checkout
  42.       - run:
  43.           name: Install Dependencies
  44.           command: npm install
  45.       - run:
  46.           name: Run Tests
  47.           command: npm run ci
  48.       - run:
  49.           name: Run Linter
  50.           command: npm run lint
  51.       - run:
  52.           name: Run Security check
  53.           command: npm audit
  54.       - run:
  55.           name: Run Code Coverage
  56.           command: npm run coverage
  57.       - store_artifacts:
  58.           path: coverage
  59.       - codecov/upload:
  60.           file: coverage
  61.   deploy:
  62.     environment:
  63.       NODE_ENV: test
  64.       JWT_SECRET: secret
  65.       JWT_EXPIRES_IN: 90d
  66.       JWT_COOKIE_EXPIRES_IN: 90
  67.       MONGOSTRING: "mongodb://localhost:27017/test"
  68.       MYSQL_ROOT_PASSWORD: rootpw
  69.       MYSQL_ALLOW_EMPTY_PASSWORD: true
  70.       MYSQL_DATABASE: test_db
  71.       MYSQL_USER: user
  72.       MYSQL_PASSWORD: ""
  73.       DB_DATABASE: test_db
  74.       DB_HOST: localhost
  75.       DB_USER: root
  76.       DB_PASSWORD: rootpw
  77.  
  78.     working_directory: ~/simpleServer
  79.     docker:
  80.       - image: circleci/node:10
  81.     steps:
  82.       - attach_workspace :
  83.           at: ~/simpleServer/dist
  84.       - add_ssh_keys:
  85.           fingerprints:
  86.            b9:10:b5:60:0d:f1:50:45:23:4d:ab:77:42:b3:90:ad
  87.       - run:
  88.           name: Deploy to remote server
  89.           command: ssh -o "StrictHostKeyChecking no" $SSH_USER@$SSH_HOST "cd ~/simpleServer; git pull origin master; npm install; npm run build:js"
  90. workflows:
  91.   version: 2
  92.   build_and_test_deploy:
  93.     jobs:
  94.      - build
  95.       - test:
  96.           requires:
  97.            - build
  98.       - deploy:
  99.           requires:
  100.            - build
  101.             - test
  102.           filters:
  103.              branches:
  104.                 only:
  105.                  - master
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement