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
c61f17b2
Commit
c61f17b2
authored
3 years ago
by
Paolo.Brasolin
Browse files
Options
Downloads
Patches
Plain Diff
ci: #be imrpved deployment
parent
f6a1b1db
No related branches found
No related tags found
No related merge requests found
Pipeline
#23178
failed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+7
-4
7 additions, 4 deletions
.gitlab-ci.yml
with
7 additions
and
4 deletions
.gitlab-ci.yml
+
7
−
4
View file @
c61f17b2
...
@@ -50,16 +50,19 @@ be-build-job:
...
@@ -50,16 +50,19 @@ be-build-job:
KUBECTL_VERSION
:
v1.8.10
KUBECTL_VERSION
:
v1.8.10
IMAGE_NAME
:
$CI_REGISTRY_IMAGE/backend
IMAGE_NAME
:
$CI_REGISTRY_IMAGE/backend
before_script
:
before_script
:
-
"
#==[
install
kubectl
]=================="
-
wget https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl
-
wget https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl
# NOTE: version is too ald and don't have sha256 available
# NOTE: version is too ald and don't have sha256 available
#- wget https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl.sha256
#- wget https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl.sha256
# - echo "$(<kubectl.sha256) kubectl" | sha256sum --check
# - echo "$(<kubectl.sha256) kubectl" | sha256sum --check
-
mv kubectl /usr/bin/ && chmod +x /usr/bin/kubectl
-
mv kubectl /usr/bin/ && chmod +x /usr/bin/kubectl
-
docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN https://$CI_REGISTRY
-
"
#==[
configure
kubectl
]================"
-
kubectl config set-cluster "k8sproduction" --server="$KUBE_URL" --certificate-authority="$KUBE_CA_PEM_FILE"
-
kubectl config set-credentials "gitlab-deploy" --token=$K8S_PRODUCTION_TOKEN
-
kubectl config set-context "$CI_PROJECT_ID" --cluster="k8sproduction" --user="gitlab-deploy" --namespace="$K8S_NAMESPACE"
-
kubectl config use-context "$CI_PROJECT_ID"
script
:
script
:
-
kubectl version --client
-
kubectl set image deployment/$K8S_DEPLOYMENT webserver=${IMAGE_NAME}:${CI_COMMIT_SHA}
-
docker pull ${IMAGE_NAME}:${CI_COMMIT_SHA}
-
kubectl --namespace $K8S_NAMESPACE set image deployment/$K8S_DEPLOYMENT webserver=${IMAGE_NAME}:${CI_COMMIT_SHA}
be-prd-deploy-job
:
be-prd-deploy-job
:
extends
:
.be-deploy-job
extends
:
.be-deploy-job
...
...
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