Skip to content
Snippets Groups Projects
Commit 6e2ca4d5 authored by Bilel El Yaagoubi's avatar Bilel El Yaagoubi
Browse files

configure CI

parent 760cdbfb
Branches
No related tags found
1 merge request!2Ocotbranche
Pipeline #42232 failed
stages:
- lint
- build
.eslint:
image: node:16.14.0-alpine
stage: lint
script:
- cd $CONTEXT
# install packages
- npm install
# Run eslint
- npm run lint
.build:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- if [ $CI_COMMIT_BRANCH = $CI_DEFAULT_BRANCH ] ; then
- TAG="latest" ; else
- TAG=$CI_COMMIT_BRANCH ; fi
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "robot\$${REGISTRY_USERNAME}" "${REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--context $CONTEXT
--dockerfile $CONTEXT/Dockerfile
--destination "${REGISTRY}/$IMAGE_NAME:${TAG}"
--cache
lint-front:
extends: .eslint
variables:
CONTEXT: frontend/
lint-back:
extends: .eslint
variables:
CONTEXT: backend/
build-front:
extends: .build
variables:
CONTEXT: frontend/
IMAGE_NAME: front
build-back:
extends: .build
variables:
CONTEXT: backend/
IMAGE_NAME: back
......@@ -5,7 +5,8 @@
"scripts": {
"dev": "dotenv nodemon ./server.js",
"start": "dotenv node ./server.js",
"lint": "eslint . --fix"
"lint": "eslint . ",
"format": "eslint . --fix"
},
"dependencies": {
"cors": "^2.8.5",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment