Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shiny-k8s-example
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Operate
Environments
Analyze
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
hub
shiny-k8s-example
Commits
4beeecc5
Commit
4beeecc5
authored
2 years ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Plain Diff
Merge branch 'testing-helm-package' into 'main'
package and upload chart See merge request hub/rshiny-k8s-example!1
parents
997d7fa1
b25caab8
No related branches found
No related tags found
1 merge request
!1
package and upload chart
Pipeline
#102673
passed
2 years ago
Stage: build
Stage: upload
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+25
-0
25 additions, 0 deletions
.gitlab-ci.yml
with
25 additions
and
0 deletions
.gitlab-ci.yml
+
25
−
0
View file @
4beeecc5
...
@@ -3,8 +3,15 @@ image: registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:latest
...
@@ -3,8 +3,15 @@ image: registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:latest
services
:
services
:
-
registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:dind
-
registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:dind
stages
:
-
build
-
upload
build
:
build
:
stage
:
build
stage
:
build
needs
:
[]
before_script
:
before_script
:
-
echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
-
echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
script
:
script
:
...
@@ -21,3 +28,21 @@ build:
...
@@ -21,3 +28,21 @@ build:
-
docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
-
docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
# push example image tagged with its commit sha (k8s purpose)
# push example image tagged with its commit sha (k8s purpose)
-
docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHORT_SHA"
-
docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHORT_SHA"
upload
:
stage
:
upload
needs
:
[]
image
:
harbor.pasteur.fr/kube-system/helm-kubectl:3.4.0
script
:
-
CHART_VERSION=$(helm show chart chart/ | grep version | cut -d' ' -f2)
-
CHART_NAME=$(helm show chart chart/ | grep name | cut -d' ' -f2)
-
|
if [ "main" == "${CI_COMMIT_REF_SLUG}" ]; then
export CHANNEL="stable"
else
export CHANNEL="${CI_COMMIT_REF_SLUG}"
fi
-
helm package chart
-
curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@${CHART_NAME}-${CHART_VERSION}.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/${CHANNEL}/charts"
\ No newline at end of file
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