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

Merge branch 'staging-ci' into 'main'

add staging deployment to CI

See merge request !34
parents 78204ee7 8f6074cf
Branches
No related tags found
1 merge request!34add staging deployment to CI
Pipeline #44351 failed
...@@ -154,6 +154,7 @@ lint-front: ...@@ -154,6 +154,7 @@ lint-front:
ssh "eatfast@$DOMAIN" ssh "eatfast@$DOMAIN"
"cd /var/www/eatfast-website/backend && "cd /var/www/eatfast-website/backend &&
git stash && git stash &&
git pull &&
git checkout "$CI_COMMIT_BRANCH" && git checkout "$CI_COMMIT_BRANCH" &&
git stash && git stash &&
git pull && git pull &&
...@@ -161,8 +162,8 @@ lint-front: ...@@ -161,8 +162,8 @@ lint-front:
docker-compose up -d && docker-compose up -d &&
exit" ; else exit" ; else
- cd ./frontend - cd ./frontend
- echo 'REACT_APP_BASE_URL_BACK="https://eatfast.cs-campus.fr/api"' > .env; - echo 'REACT_APP_BASE_URL_BACK="https://$DOMAIN/api"' > .env;
- echo 'REACT_APP_BASE_URL_FRONT="https://eatfast.cs-campus.fr"' >> .env; - echo 'REACT_APP_BASE_URL_FRONT="https://$DOMAIN"' >> .env;
- 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
...@@ -200,3 +201,32 @@ deploy-front-prod: ...@@ -200,3 +201,32 @@ deploy-front-prod:
IMAGE: "front" IMAGE: "front"
dependencies: dependencies:
- install-npm-packages - install-npm-packages
deploy-back-staging:
extends: .deploy
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: $CI_COMMIT_BRANCH
when: always
variables:
DOMAIN: eatfast.test.cs-campus.fr
PRIVATE_KEY: "$SSH_PRIVATE_KEY_STAGING"
IMAGE: "back"
dependencies: []
deploy-front-staging:
extends: .deploy
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: $CI_COMMIT_BRANCH
when: always
variables:
DOMAIN: eatfast.test.cs-campus.fr
PRIVATE_KEY: "$SSH_PRIVATE_KEY_STAGING"
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