Skip to content
Snippets Groups Projects
Commit 261e066c authored by Antoine Gaudron-Desjardins's avatar Antoine Gaudron-Desjardins
Browse files

Merge branch 'linting' into 'main'

improve ci

See merge request !22
parents 294c0cc9 f1b2b931
No related branches found
No related tags found
1 merge request!22improve ci
Pipeline #43831 passed
...@@ -26,17 +26,6 @@ image: python:3.9 ...@@ -26,17 +26,6 @@ image: python:3.9
# Password: $MYSQL_PASSWORD # Password: $MYSQL_PASSWORD
# Database: $MYSQL_DATABASE # Database: $MYSQL_DATABASE
# cache:
# paths:
# - .cache/pip
# - venv/
# - env/
# before_script:
# - python --version # For debugging
# - pip install venv
# - python3 -m venv /venv
# - source /venv/bin/activate
stages: stages:
- build - build
...@@ -48,6 +37,11 @@ workflow: ...@@ -48,6 +37,11 @@ workflow:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
cache:
paths:
- venv/
- frontend/node_modules/
# include: # include:
# - template: 'Code-Quality.gitlab-ci.yml' # - template: 'Code-Quality.gitlab-ci.yml'
...@@ -57,17 +51,21 @@ workflow: ...@@ -57,17 +51,21 @@ workflow:
#### #### #### ####
####################################################################################################################################### #######################################################################################################################################
install: install-virtualenv:
stage: build stage: build
script: script:
- python3 -m venv ./venv - python3 -m venv venv/
- source ./venv/bin/activate - source venv/bin/activate
- pip install --upgrade pip && pip install pip-tools - pip install --upgrade pip && pip install pip-tools
- pip install -r ./backend/requirements.txt - pip install -r ./backend/requirements.txt
artifacts:
paths:
- ./venv/ install-npm-packages:
expire_in: 30 mins image: node:14.6.0
stage: build
script:
- cd ./frontend
- npm ci
####################################################################################################################################### #######################################################################################################################################
#### #### #### ####
...@@ -78,20 +76,22 @@ install: ...@@ -78,20 +76,22 @@ install:
lint-back: lint-back:
stage: test stage: test
before_script: before_script:
- source ./venv/bin/activate - source venv/bin/activate
- pip install pycodestyle - pip install pycodestyle
script: script:
- pycodestyle --config=./backend/setup.cnf ./backend - pycodestyle --config=./backend/setup.cnf ./backend
dependencies:
- install-virtualenv
lint-front: lint-front:
image: node:14.6.0 image: node:14.6.0
stage: test stage: test
before_script:
- cd frontend/
- npm install
script: script:
- cd frontend/
- npm run lint - npm run lint
dependencies:
- install-npm-packages
# test: # test:
...@@ -161,7 +161,7 @@ lint-front: ...@@ -161,7 +161,7 @@ lint-front:
- cd ./frontend - cd ./frontend
- echo 'REACT_APP_BASE_URL_BACK="http://eatfast.cs-campus.fr/api"' > .env; - echo 'REACT_APP_BASE_URL_BACK="http://eatfast.cs-campus.fr/api"' > .env;
- echo 'REACT_APP_BASE_URL_FRONT="http://eatfast.cs-campus.fr"' >> .env; - echo 'REACT_APP_BASE_URL_FRONT="http://eatfast.cs-campus.fr"' >> .env;
- npm install && npm run build - npm run build;
- scp -r build/ eatfast@"$DOMAIN":/var/www/eatfast-website/frontend ; fi - scp -r build/ eatfast@"$DOMAIN":/var/www/eatfast-website/frontend ; fi
...@@ -184,6 +184,7 @@ deploy-back-prod: ...@@ -184,6 +184,7 @@ deploy-back-prod:
DOMAIN: eatfast.cs-campus.fr DOMAIN: eatfast.cs-campus.fr
PRIVATE_KEY: "$SSH_PRIVATE_KEY" PRIVATE_KEY: "$SSH_PRIVATE_KEY"
IMAGE: "back" IMAGE: "back"
dependencies: []
deploy-front-prod: deploy-front-prod:
...@@ -195,3 +196,5 @@ deploy-front-prod: ...@@ -195,3 +196,5 @@ deploy-front-prod:
DOMAIN: eatfast.cs-campus.fr DOMAIN: eatfast.cs-campus.fr
PRIVATE_KEY: "$SSH_PRIVATE_KEY" PRIVATE_KEY: "$SSH_PRIVATE_KEY"
IMAGE: "front" IMAGE: "front"
dependencies:
- install-npm-packages
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment