Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
oetzit
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
Container 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
commul
oetzit
Commits
957a5130
Commit
957a5130
authored
3 years ago
by
Paolo.Brasolin
Browse files
Options
Downloads
Patches
Plain Diff
ci: clean up
parent
801c041b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+83
-75
83 additions, 75 deletions
.gitlab-ci.yml
with
83 additions
and
75 deletions
.gitlab-ci.yml
+
83
−
75
View file @
957a5130
variables
:
variables
:
DOCKER_TLS_CERTDIR
:
"
"
# HACK: see https://gitlab.com/gitlab-org/gitlab-runner/issues/4501
DOCKER_TLS_CERTDIR
:
"
"
# HACK: see https://gitlab.com/gitlab-org/gitlab-runner/issues/4501
DOCKER_IMAGE
:
"
docker:20.10.12"
stages
:
stages
:
-
setup
-
setup
...
@@ -8,7 +7,9 @@ stages:
...
@@ -8,7 +7,9 @@ stages:
-
build
-
build
-
deploy
-
deploy
#==[ Node jobs templates ]======================================================
# TODO: maybe stup some notifications as a last stage?
#==[ JOB TEMPLATES ]============================================================
.node-job
:
&node-job
.node-job
:
&node-job
image
:
node:16-alpine
image
:
node:16-alpine
...
@@ -42,7 +43,9 @@ stages:
...
@@ -42,7 +43,9 @@ stages:
-
cd backend
-
cd backend
-
npm ci --cache .npm --prefer-offline
-
npm ci --cache .npm --prefer-offline
#==[ Frontent cache ]===========================================================
#==[ SETUP STAGE ]==============================================================
#--[ Frontend ]-----------------------------------------------------------------
cache-fe-node-job
:
cache-fe-node-job
:
extends
:
.fe-node-job
extends
:
.fe-node-job
...
@@ -50,7 +53,7 @@ cache-fe-node-job:
...
@@ -50,7 +53,7 @@ cache-fe-node-job:
script
:
script
:
-
echo "Done!"
-
echo "Done!"
#
==
[ Backend
cache ]============================================================
#
--
[ Backend
]------------------------------------------------------------------
cache-be-node-job
:
cache-be-node-job
:
extends
:
.be-node-job
extends
:
.be-node-job
...
@@ -58,7 +61,9 @@ cache-be-node-job:
...
@@ -58,7 +61,9 @@ cache-be-node-job:
script
:
script
:
-
echo "Done!"
-
echo "Done!"
#==[ Frontend checks ]==========================================================
#==[ CHECK STAGE ]==============================================================
#--[ Frontend ]-----------------------------------------------------------------
.check-fe-node-job
:
&check-fe-node-job
.check-fe-node-job
:
&check-fe-node-job
extends
:
.fe-node-job
extends
:
.fe-node-job
...
@@ -81,7 +86,7 @@ test-fe-node-job:
...
@@ -81,7 +86,7 @@ test-fe-node-job:
script
:
script
:
-
npm run test
-
npm run test
#
==
[ Backend
checks ]===========================================================
#
--
[ Backend
]------------------------------------------------------------------
.check-be-node-job
:
&check-be-node-job
.check-be-node-job
:
&check-be-node-job
extends
:
.be-node-job
extends
:
.be-node-job
...
@@ -104,12 +109,39 @@ test-be-node-job:
...
@@ -104,12 +109,39 @@ test-be-node-job:
script
:
script
:
-
npm run test
-
npm run test
#==[ Backend build ]============================================================
#==[ BUILD STAGE ]==============================================================
#--[ Frontend ]-----------------------------------------------------------------
.fe-build-job
:
image
:
node:16-alpine
stage
:
build
tags
:
-
commul
cache
:
-
key
:
files
:
-
frontend/package-lock.json
paths
:
-
frontend/node_modules
script
:
-
cd frontend
-
npm install
-
npm run build
artifacts
:
paths
:
-
frontend/dist/
# TODO: set expiration in docker registry too
expire_in
:
1 week
only
:
-
tags
-
development
#--[ Backend ]------------------------------------------------------------------
# TODO: cache docker layers
# TODO: cache docker layers
# TODO: build ts
.be-build-job
:
.be-build-job
:
image
:
$DOCKER_IMAGE
image
:
docker:20.10.12
stage
:
build
stage
:
build
tags
:
tags
:
-
commul
-
commul
...
@@ -133,110 +165,86 @@ test-be-node-job:
...
@@ -133,110 +165,86 @@ test-be-node-job:
-
tags
-
tags
-
development
-
development
#==[
Backend deployment ]
=======================================================
#==[
DEPLOY STAGE ]======
=======================================================
.be-deploy-job
:
#--[ Frontend ]-----------------------------------------------------------------
.fe-deploy-job
:
image
:
alpine:latest
image
:
alpine:latest
stage
:
deploy
stage
:
deploy
needs
:
needs
:
-
job
:
b
e-build-job
-
job
:
f
e-build-job
artifacts
:
fals
e
artifacts
:
tru
e
tags
:
tags
:
-
commul
-
commul
variables
:
IMAGE_NAME
:
$CI_REGISTRY_IMAGE/backend
before_script
:
before_script
:
-
./ci/install-
kubectl
-on-alpine.sh
-
./ci/install-
butler
-on-alpine.sh
script
:
script
:
-
kubectl set image deployment/${K8S_DEPLOYMENT} oetzi=${IMAGE_NAME}:${CI_COMMIT_SHA} --namespace=${K8S_NAMESPACE}
-
>
butler push
frontend/dist
eurac/$GAME_NAME:html5
--userversion ${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}
.
b
e-prd-deploy-job
:
.
f
e-prd-deploy-job
:
extends
:
.
b
e-deploy-job
extends
:
.
f
e-deploy-job
environment
:
environment
:
name
:
production/
back
end
name
:
production/
front
end
deployment_tier
:
production
deployment_tier
:
production
url
:
https://
kommul.eurac.edu
/oetzi
url
:
https://
eurac.itch.io
/oetzi
variables
:
variables
:
K8S_NAMESPACE
:
kommul
GAME_NAME
:
oetzi
K8S_DEPLOYMENT
:
oetzi-webserver-deployment
only
:
only
:
-
tags
-
tags
.
b
e-stg-deploy-job
:
.
f
e-stg-deploy-job
:
extends
:
.
b
e-deploy-job
extends
:
.
f
e-deploy-job
environment
:
environment
:
name
:
staging/
back
end
name
:
staging/
front
end
deployment_tier
:
staging
deployment_tier
:
staging
url
:
https://
kommul-dev.eurac.edu/oetzi
url
:
https://
eurac.itch.io/oetzi-staging
variables
:
variables
:
K8S_NAMESPACE
:
kommul-dev
GAME_NAME
:
oetzi-staging
K8S_DEPLOYMENT
:
oetzi-webserver-deployment
only
:
-
development
#==[ Frontend build ]===========================================================
.fe-build-job
:
image
:
node:16-alpine
stage
:
build
tags
:
-
commul
cache
:
-
key
:
files
:
-
frontend/package-lock.json
paths
:
-
frontend/node_modules
script
:
-
cd frontend
-
npm install
-
npm run build
artifacts
:
paths
:
-
frontend/dist/
# TODO: set expiration in docker registry too
expire_in
:
1 week
only
:
only
:
-
tags
-
development
-
development
#
==[ Frontend deployment ]======================================================
#
--[ Backend ]------------------------------------------------------------------
.
f
e-deploy-job
:
.
b
e-deploy-job
:
image
:
alpine:latest
image
:
alpine:latest
stage
:
deploy
stage
:
deploy
needs
:
needs
:
-
job
:
f
e-build-job
-
job
:
b
e-build-job
artifacts
:
tru
e
artifacts
:
fals
e
tags
:
tags
:
-
commul
-
commul
variables
:
IMAGE_NAME
:
$CI_REGISTRY_IMAGE/backend
before_script
:
before_script
:
-
./ci/install-
butler
-on-alpine.sh
-
./ci/install-
kubectl
-on-alpine.sh
script
:
script
:
-
>
-
kubectl set image deployment/${K8S_DEPLOYMENT} oetzi=${IMAGE_NAME}:${CI_COMMIT_SHA} --namespace=${K8S_NAMESPACE}
butler push
frontend/dist
eurac/$GAME_NAME:html5
--userversion ${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}
.
f
e-prd-deploy-job
:
.
b
e-prd-deploy-job
:
extends
:
.
f
e-deploy-job
extends
:
.
b
e-deploy-job
environment
:
environment
:
name
:
production/
front
end
name
:
production/
back
end
deployment_tier
:
production
deployment_tier
:
production
url
:
https://
eurac.itch.io
/oetzi
url
:
https://
kommul.eurac.edu
/oetzi
variables
:
variables
:
GAME_NAME
:
oetzi
K8S_NAMESPACE
:
kommul
K8S_DEPLOYMENT
:
oetzi-webserver-deployment
only
:
only
:
-
tags
-
tags
.
f
e-stg-deploy-job
:
.
b
e-stg-deploy-job
:
extends
:
.
f
e-deploy-job
extends
:
.
b
e-deploy-job
environment
:
environment
:
name
:
staging/
front
end
name
:
staging/
back
end
deployment_tier
:
staging
deployment_tier
:
staging
url
:
https://
eurac.itch.io/oetzi-staging
url
:
https://
kommul-dev.eurac.edu/oetzi
variables
:
variables
:
GAME_NAME
:
oetzi-staging
K8S_NAMESPACE
:
kommul-dev
K8S_DEPLOYMENT
:
oetzi-webserver-deployment
only
:
only
:
-
development
-
development
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