Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MVP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SO
OC
MVP
Commits
31b49acd
Commit
31b49acd
authored
7 months ago
by
Mathieu Dartigues
Browse files
Options
Downloads
Patches
Plain Diff
Adding .htaccess
parent
7e174200
Branches
Branches containing commit
No related tags found
1 merge request
!60
Adding .htaccess
Pipeline
#10634
passed
7 months ago
Stage: build
Stage: deploy
Stage: teardown
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+78
-66
78 additions, 66 deletions
.gitlab-ci.yml
public/.htaccess
+6
-0
6 additions, 0 deletions
public/.htaccess
with
84 additions
and
66 deletions
.gitlab-ci.yml
+
78
−
66
View file @
31b49acd
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
image
:
node:20
image
:
node:20
stages
:
stages
:
-
test
#
- test
-
build
-
build
-
deploy
-
deploy
-
teardown
-
teardown
...
@@ -45,15 +45,15 @@ stages:
...
@@ -45,15 +45,15 @@ stages:
-
echo "$SSH_PRIVATE_KEY_DEPLOY_FRONT_ED25519" | tr -d '\r' | ssh-add -
-
echo "$SSH_PRIVATE_KEY_DEPLOY_FRONT_ED25519" | tr -d '\r' | ssh-add -
-
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
-
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
quality-gate
:
#
quality-gate:
image
:
mcr.microsoft.com/playwright:v1.47.1-noble
#
image: mcr.microsoft.com/playwright:v1.47.1-noble
stage
:
test
#
stage: test
only
:
#
only:
-
merge_requests
#
- merge_requests
script
:
#
script:
-
npm ci
#
- npm ci
-
npm run lint
#
- npm run lint
-
npm run test:unit
#
- npm run test:unit
build
:
build
:
stage
:
build
stage
:
build
...
@@ -73,19 +73,19 @@ build:
...
@@ -73,19 +73,19 @@ build:
paths
:
paths
:
-
./dist/
-
./dist/
build-storybook
:
#
build-storybook:
stage
:
build
#
stage: build
only
:
#
only:
-
tags
#
- tags
-
merge_requests
#
- merge_requests
-
main
#
- main
script
:
#
script:
-
npm ci
#
- npm ci
-
npm run build-storybook
#
- npm run build-storybook
artifacts
:
#
artifacts:
expire_in
:
3 week
#
expire_in: 3 week
paths
:
#
paths:
-
./storybook-static/
#
- ./storybook-static/
deploy
:
deploy
:
<<
:
*check_ssh
<<
:
*check_ssh
...
@@ -103,9 +103,21 @@ deploy:
...
@@ -103,9 +103,21 @@ deploy:
-
apt install rsync -y
-
apt install rsync -y
-
echo "Will deploy to ${DELIVERY_DIRECTORY}"
-
echo "Will deploy to ${DELIVERY_DIRECTORY}"
# - echo "
# <Directory "/var/www/html/$DELIVERY_DIRECTORY">
# FallbackResource /$DELIVERY_DIRECTORY/index.html
# </Directory>
# <Directory "./">
# FallbackResource ./index.html
# </Directory>
# " >> ./dist/.htaccess
# - ssh gitlab@so-frontend-dev.irit.fr "ls -al /var/www/html${DELIVERY_DIRECTORY}"
# - ssh gitlab@so-frontend-dev.irit.fr "more /var/www/html${DELIVERY_DIRECTORY}/.htaccess"
-
ssh gitlab@so-frontend-dev.irit.fr "rm -rf /var/www/html${DELIVERY_DIRECTORY}"
-
ssh gitlab@so-frontend-dev.irit.fr "rm -rf /var/www/html${DELIVERY_DIRECTORY}"
-
rsync -ravP --delete ./dist/ gitlab@so-frontend-dev.irit.fr:/var/www/html${DELIVERY_DIRECTORY}/
-
rsync -ravP --delete ./dist/ gitlab@so-frontend-dev.irit.fr:/var/www/html${DELIVERY_DIRECTORY}/
-
ssh gitlab@so-frontend-dev.irit.fr "ls -al /var/www/html${DELIVERY_DIRECTORY}"
-
ssh gitlab@so-frontend-dev.irit.fr "more /var/www/html${DELIVERY_DIRECTORY}/.htaccess"
# Copie de la dernière version commiter sur le main sur le chemin /last aussi
# Copie de la dernière version commiter sur le main sur le chemin /last aussi
# - if [ "$CI_COMMIT_BRANCH" == "main" ]; then rsync -rav --delete ./dist gitlab@so-frontend-dev.irit.fr:/var/www/html/mvp-last; fi
# - if [ "$CI_COMMIT_BRANCH" == "main" ]; then rsync -rav --delete ./dist gitlab@so-frontend-dev.irit.fr:/var/www/html/mvp-last; fi
...
@@ -115,33 +127,33 @@ deploy:
...
@@ -115,33 +127,33 @@ deploy:
auto_stop_in
:
2 months
auto_stop_in
:
2 months
on_stop
:
teardown
on_stop
:
teardown
deploy-storybook
:
#
deploy-storybook:
<<
:
*check_ssh
#
<<: *check_ssh
stage
:
deploy
#
stage: deploy
variables
:
#
variables:
DELIVERY_DIRECTORY_STORYBOOK
:
'
/mvps-${CI_COMMIT_REF_SLUG}'
#
DELIVERY_DIRECTORY_STORYBOOK: '/mvps-${CI_COMMIT_REF_SLUG}'
only
:
#
only:
-
tags
#
- tags
-
merge_requests
#
- merge_requests
-
main
#
- main
dependencies
:
#
dependencies:
-
build-storybook
#
- build-storybook
script
:
#
script:
-
apt update
#
- apt update
-
apt install rsync -y
#
- apt install rsync -y
-
echo "Will deploy to ${DELIVERY_DIRECTORY_STORYBOOK}"
#
- echo "Will deploy to ${DELIVERY_DIRECTORY_STORYBOOK}"
-
ssh gitlab@so-frontend-dev.irit.fr "rm -rf /var/www/html${DELIVERY_DIRECTORY_STORYBOOK}"
#
- ssh gitlab@so-frontend-dev.irit.fr "rm -rf /var/www/html${DELIVERY_DIRECTORY_STORYBOOK}"
-
rsync -ravP --delete ./storybook-static/ gitlab@so-frontend-dev.irit.fr:/var/www/html${DELIVERY_DIRECTORY_STORYBOOK}/
#
- rsync -ravP --delete ./storybook-static/ gitlab@so-frontend-dev.irit.fr:/var/www/html${DELIVERY_DIRECTORY_STORYBOOK}/
# Copie de la dernière version commiter sur le main sur le chemin /last aussi
#
# Copie de la dernière version commiter sur le main sur le chemin /last aussi
# - if [ "$CI_COMMIT_BRANCH" == "main" ]; then rsync -rav --delete ./dist gitlab@so-frontend-dev.irit.fr:/var/www/html/mvp-last; fi
#
# - if [ "$CI_COMMIT_BRANCH" == "main" ]; then rsync -rav --delete ./dist gitlab@so-frontend-dev.irit.fr:/var/www/html/mvp-last; fi
environment
:
#
environment:
name
:
review/mvps-${CI_COMMIT_REF_SLUG}
#
name: review/mvps-${CI_COMMIT_REF_SLUG}
url
:
https://opencommon.irit.fr/mvps-${CI_COMMIT_REF_SLUG}
#
url: https://opencommon.irit.fr/mvps-${CI_COMMIT_REF_SLUG}
auto_stop_in
:
2 months
#
auto_stop_in: 2 months
on_stop
:
teardown-storybook
#
on_stop: teardown-storybook
teardown
:
teardown
:
<<
:
*check_ssh
<<
:
*check_ssh
...
@@ -159,18 +171,18 @@ teardown:
...
@@ -159,18 +171,18 @@ teardown:
-
echo "Fin de la MR => on supprime le répertoire déployé $DELIVERY_DIRECTORY"
-
echo "Fin de la MR => on supprime le répertoire déployé $DELIVERY_DIRECTORY"
-
ssh gitlab@so-frontend-dev.irit.fr "rm -rf /var/www/html${DELIVERY_DIRECTORY}"
-
ssh gitlab@so-frontend-dev.irit.fr "rm -rf /var/www/html${DELIVERY_DIRECTORY}"
teardown-storybook
:
#
teardown-storybook:
<<
:
*check_ssh
#
<<: *check_ssh
stage
:
teardown
#
stage: teardown
only
:
#
only:
-
merge_requests
#
- merge_requests
variables
:
#
variables:
GIT_STRATEGY
:
none
#
GIT_STRATEGY: none
DELIVERY_DIRECTORY_STORYBOOK
:
'
/mvps-${CI_COMMIT_REF_SLUG}'
#
DELIVERY_DIRECTORY_STORYBOOK: '/mvps-${CI_COMMIT_REF_SLUG}'
when
:
manual
#
when: manual
environment
:
#
environment:
name
:
review/mvps-${CI_COMMIT_REF_SLUG}
#
name: review/mvps-${CI_COMMIT_REF_SLUG}
action
:
stop
#
action: stop
script
:
#
script:
-
echo "Fin de la MR => on supprime le répertoire storybook déployé $DELIVERY_DIRECTORY_STORYBOOK"
#
- echo "Fin de la MR => on supprime le répertoire storybook déployé $DELIVERY_DIRECTORY_STORYBOOK"
-
ssh gitlab@so-frontend-dev.irit.fr "rm -rf /var/www/html${DELIVERY_DIRECTORY_STORYBOOK}"
#
- ssh gitlab@so-frontend-dev.irit.fr "rm -rf /var/www/html${DELIVERY_DIRECTORY_STORYBOOK}"
This diff is collapsed.
Click to expand it.
public/.htaccess
0 → 100644
+
6
−
0
View file @
31b49acd
<
Directory
"/var/www/html/mvp-36-apache"
>
FallbackResource
/mvp-36-apache/index.html
</
Directory
>
<
Directory
"./"
>
FallbackResource
./index.html
</
Directory
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment