Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Website
Manage
Activity
Members
Labels
Plan
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
Website
Commits
ec5a301b
Verified
Commit
ec5a301b
authored
Feb 6, 2022
by
Rafael László
Browse files
Options
Downloads
Patches
Plain Diff
Add staging
parent
e9be5471
No related branches found
No related tags found
No related merge requests found
Pipeline
#17209
canceled
Feb 6, 2022
Stage: build
Stage: container
Stage: deploy
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+40
-3
40 additions, 3 deletions
.gitlab-ci.yml
k8s/deployment.yaml
+3
-4
3 additions, 4 deletions
k8s/deployment.yaml
k8s/ingress.yaml
+3
-3
3 additions, 3 deletions
k8s/ingress.yaml
k8s/service.yaml
+1
-1
1 addition, 1 deletion
k8s/service.yaml
with
47 additions
and
11 deletions
.gitlab-ci.yml
+
40
−
3
View file @
ec5a301b
stages
:
stages
:
-
build
-
build
-
container
-
deploy
-
deploy
variables
:
CI_REGISTRY_IMAGE
:
${CI_REGISTRY}/${CI_PROJECT_NAME}
KUBECONFIG_VAR_NAME
:
KUBECONFIG
build
:
build
:
image
:
node:17-alpine3.14
image
:
node:17-alpine3.14
stage
:
build
stage
:
build
...
@@ -13,6 +18,8 @@ build:
...
@@ -13,6 +18,8 @@ build:
artifacts
:
artifacts
:
paths
:
paths
:
-
public
-
public
only
:
-
master
prod-ftp
:
prod-ftp
:
stage
:
deploy
stage
:
deploy
...
@@ -25,9 +32,39 @@ prod-ftp:
...
@@ -25,9 +32,39 @@ prod-ftp:
-
'
eval
$(ssh-agent
-s)'
-
'
eval
$(ssh-agent
-s)'
-
'
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\nport
10022\n\n"
>
~/.ssh/config'
-
'
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\nport
10022\n\n"
>
~/.ssh/config'
-
lftp -e "set dns:order 'inet inet6'; set net:timeout 5; set net:max-retries 2; set net:reconnect-interval-base 5; mirror --parallel=10 --delete --verbose -R public/ site/kszk/ ; quit" -u $FTP_USER,$FTP_PASS $FTP_HOST -p
10022
-
lftp -e "set dns:order 'inet inet6'; set net:timeout 5; set net:max-retries 2; set net:reconnect-interval-base 5; mirror --parallel=10 --delete --verbose -R public/ site/kszk/ ; quit" -u $FTP_USER,$FTP_PASS $FTP_HOST -p
10022
only
:
-
tags
container
:
stage
:
container
dependencies
:
-
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
before_script
:
-
mkdir -p /kaniko/.docker
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
script
:
-
|
/kaniko/executor --context ${CI_PROJECT_DIR} \
--dockerfile ${CI_PROJECT_DIR}/Dockerfile \
--destination ${CI_REGISTRY_IMAGE}:latest
only
:
only
:
-
master
-
master
except
:
except
:
-
tags
-
tags
# staging-k8s:
# TODO
staging-k8s
:
stage
:
deploy
image
:
name
:
harbor.sch.bme.hu/k8s/kube-tools:latest
entrypoint
:
[
"
"
]
before_script
:
-
chmod 600 ${!KUBECONFIG_VAR_NAME}
-
export KUBECONFIG=${!KUBECONFIG_VAR_NAME}
script
:
-
kubectl rollout restart deployment kszk-website
only
:
-
master
This diff is collapsed.
Click to expand it.
k8s/deployment.yaml
+
3
−
4
View file @
ec5a301b
...
@@ -2,7 +2,7 @@ apiVersion: apps/v1
...
@@ -2,7 +2,7 @@ apiVersion: apps/v1
kind
:
Deployment
kind
:
Deployment
metadata
:
metadata
:
name
:
kszk-website
name
:
kszk-website
namespace
:
util
it
y
namespace
:
kszk-webs
it
e
spec
:
spec
:
selector
:
selector
:
matchLabels
:
matchLabels
:
...
@@ -14,11 +14,10 @@ spec:
...
@@ -14,11 +14,10 @@ spec:
spec
:
spec
:
containers
:
containers
:
-
name
:
kszk-website
-
name
:
kszk-website
image
:
harbor.sch.bme.hu/
k8s/
kszk
-
website:latest
image
:
harbor.sch.bme.hu/kszk
/
website:latest
resources
:
resources
:
limits
:
limits
:
memory
:
"
128Mi"
memory
:
"
64Mi"
cpu
:
"
100m"
ports
:
ports
:
-
containerPort
:
80
-
containerPort
:
80
imagePullSecrets
:
imagePullSecrets
:
...
...
This diff is collapsed.
Click to expand it.
k8s/ingress.yaml
+
3
−
3
View file @
ec5a301b
...
@@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1
...
@@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1
kind
:
Ingress
kind
:
Ingress
metadata
:
metadata
:
name
:
kszk-website
name
:
kszk-website
namespace
:
util
it
y
namespace
:
kszk-webs
it
e
labels
:
labels
:
name
:
kszk-website
name
:
kszk-website
annotations
:
annotations
:
...
@@ -12,10 +12,10 @@ metadata:
...
@@ -12,10 +12,10 @@ metadata:
spec
:
spec
:
tls
:
tls
:
-
hosts
:
-
hosts
:
-
kszk-website.k8s-01
.sch.bme.hu
-
staging.kszk
.sch.bme.hu
secretName
:
kszk-website-cert
secretName
:
kszk-website-cert
rules
:
rules
:
-
host
:
kszk-website.k8s-01
.sch.bme.hu
-
host
:
staging.kszk
.sch.bme.hu
http
:
http
:
paths
:
paths
:
-
pathType
:
Prefix
-
pathType
:
Prefix
...
...
This diff is collapsed.
Click to expand it.
k8s/service.yaml
+
1
−
1
View file @
ec5a301b
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
kszk-website
name
:
kszk-website
namespace
:
util
it
y
namespace
:
kszk-webs
it
e
spec
:
spec
:
selector
:
selector
:
app
:
kszk-website
app
:
kszk-website
...
...
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