Remove node_modules artifacts, rely on cache for shell executor
This commit is contained in:
@@ -10,10 +10,11 @@
|
|||||||
# 5. deploy — restart services on the local machine (manual trigger)
|
# 5. deploy — restart services on the local machine (manual trigger)
|
||||||
#
|
#
|
||||||
# Executor: shell (runs directly on dashboard-dev using system Node.js)
|
# Executor: shell (runs directly on dashboard-dev using system Node.js)
|
||||||
|
# Uses cache (not artifacts) for node_modules to avoid upload size limits.
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Global cache — speeds up repeated runs by reusing node_modules
|
# Global cache — persists node_modules between pipeline runs on this runner
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
cache:
|
cache:
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
key: ${CI_COMMIT_REF_SLUG}
|
||||||
@@ -39,20 +40,12 @@ install-backend:
|
|||||||
stage: install
|
stage: install
|
||||||
script:
|
script:
|
||||||
- npm install
|
- npm install
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- node_modules/
|
|
||||||
expire_in: 1 hour
|
|
||||||
|
|
||||||
install-frontend:
|
install-frontend:
|
||||||
stage: install
|
stage: install
|
||||||
script:
|
script:
|
||||||
- cd frontend
|
- cd frontend
|
||||||
- npm install
|
- npm install
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- frontend/node_modules/
|
|
||||||
expire_in: 1 hour
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# STAGE 2: Lint / static analysis
|
# STAGE 2: Lint / static analysis
|
||||||
@@ -60,9 +53,9 @@ install-frontend:
|
|||||||
|
|
||||||
lint-frontend:
|
lint-frontend:
|
||||||
stage: lint
|
stage: lint
|
||||||
needs: ["install-frontend"]
|
|
||||||
script:
|
script:
|
||||||
- cd frontend
|
- cd frontend
|
||||||
|
- npm install
|
||||||
- npx eslint src/ --max-warnings 0
|
- npx eslint src/ --max-warnings 0
|
||||||
allow_failure: true # non-blocking until the team cleans up existing warnings
|
allow_failure: true # non-blocking until the team cleans up existing warnings
|
||||||
|
|
||||||
@@ -72,16 +65,16 @@ lint-frontend:
|
|||||||
|
|
||||||
test-backend:
|
test-backend:
|
||||||
stage: test
|
stage: test
|
||||||
needs: ["install-backend"]
|
|
||||||
script:
|
script:
|
||||||
|
- npm install
|
||||||
- npx jest --ci --forceExit --detectOpenHandles backend/__tests__/
|
- npx jest --ci --forceExit --detectOpenHandles backend/__tests__/
|
||||||
timeout: 5 minutes
|
timeout: 5 minutes
|
||||||
|
|
||||||
test-frontend:
|
test-frontend:
|
||||||
stage: test
|
stage: test
|
||||||
needs: ["install-frontend"]
|
|
||||||
script:
|
script:
|
||||||
- cd frontend
|
- cd frontend
|
||||||
|
- npm install
|
||||||
- CI=true npx react-scripts test --watchAll=false --ci --forceExit
|
- CI=true npx react-scripts test --watchAll=false --ci --forceExit
|
||||||
timeout: 5 minutes
|
timeout: 5 minutes
|
||||||
|
|
||||||
@@ -91,9 +84,9 @@ test-frontend:
|
|||||||
|
|
||||||
build-frontend:
|
build-frontend:
|
||||||
stage: build
|
stage: build
|
||||||
needs: ["install-frontend", "test-frontend"]
|
|
||||||
script:
|
script:
|
||||||
- cd frontend
|
- cd frontend
|
||||||
|
- npm install
|
||||||
- REACT_APP_API_BASE=/api REACT_APP_API_HOST="" npm run build
|
- REACT_APP_API_BASE=/api REACT_APP_API_HOST="" npm run build
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
@@ -111,7 +104,6 @@ build-frontend:
|
|||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
needs: ["build-frontend"]
|
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master"
|
- if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master"
|
||||||
when: manual
|
when: manual
|
||||||
|
|||||||
Reference in New Issue
Block a user