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/node:12" - image: circleci/postgres:9.6.2-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: false - run: | TAG=latest DOCKERHUB_USERNAME=ahlemfahem1 DOCKERHUB_PASSWORD=231993amira docker build -t ahlemfahem1/projectci:$TAG . echo $DOCKER_PASS | docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD docker push ahlemfahem1/projectci:$TAG doc_generate: docker: - image: "circleci/node:12" steps: - checkout - restore_cache: key: yarn-cache{{ checksum "yarn.lock" }} - run: command: yarn doc:build - store_artifacts: path: ./doc-server workflows: build: jobs: - "build" - "test" - "lint" - "test-e2e" - "build_docker_file" - "doc_generate"