Yield generated for 0ce70447-d401-4fb5-82ab-22a49b5a3022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

97 lines
2.7 KiB

version: 2.1 # Use version 2.1 to enable orb usage.
orbs:
win: circleci/windows@2.2.0 # The Windows orb give you everything you need to start using the Windows executor.
jobs:
build:
docker:
- image: "circleci/node:12"
steps:
- checkout
- restore_cache:
key: yarn-cache{{ checksum "yarn.lock" }}
- run:
name : install-yarn
command : 'yarn global add node-gyp && yarn install'
- save_cache:
key: yarn-cache{{ checksum "yarn.lock" }}
paths:
- ./node_modules
test:
docker:
- image: "circleci/node:12"
steps:
- checkout
- restore_cache:
key: yarn-cache{{ checksum "yarn.lock" }}
- run: yarn test:ci
- save_cache:
key: yarn-cache{{ checksum "yarn.lock" }}
paths:
- ./node_modules
lint:
docker:
- image: "circleci/node:12"
steps:
- checkout
- restore_cache:
key: yarn-cache{{ checksum "yarn.lock" }}
- run: yarn lint && yarn format:check
- save_cache:
key: yarn-cache{{ checksum "yarn.lock" }}
paths:
- ./node_modules
test-e2e:
docker:
- image: "circleci/node:12"
- image: circleci/postgres:9.6.2-alpine
environment:
- POSTGRES_USER=ahlemfahem
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=projetCi
steps:
- checkout
- restore_cache:
key: yarn-cache{{ checksum "yarn.lock" }}
- run:
command : yarn test:e2e
environment :
DATABASE_URL: postgres://ahlemfahem:admin@localhost:5432/projetCi
JWT_SECRET: hihi
API_PORT: 3000
API_HOST: localhost
API_PROTOCOL: http
- save_cache:
key: yarn-cache{{ checksum "yarn.lock" }}
paths:
- ./node_modules
build_docker_file :
docker:
- image: circleci/golang:1.13-alpine
auth:
username: ahlemfahem1
password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
steps:
- checkout
- restore_cache:
key: yarn-cache{{ checksum "yarn.lock" }}
- run: yarn install
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
# build and push Docker image
- run: |
TAG=0.1.$CIRCLE_BUILD_NUM
docker build -t ahlemfahem1/projectci:latest .
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
docker push ahlemfahem1/projectci:latest
workflows:
build:
jobs:
- "build"
- "test"
- "lint"
- "test-e2e"
- "build_docker_file"