Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shiny-k8s
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub
shiny-k8s
Commits
debbc588
Commit
debbc588
authored
2 years ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
trigger pipeline on r and python example branch
parent
26d5add8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#106639
canceled
2 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+36
-20
36 additions, 20 deletions
.gitlab-ci.yml
with
36 additions
and
20 deletions
.gitlab-ci.yml
+
36
−
20
View file @
debbc588
...
...
@@ -20,51 +20,67 @@ build:
export VERSIONS_TAG="${R_VERSION}--${SHINY_SERVER_VERSION}"
fi
fi
-
apk add gettext
-
envsubst < ./Dockerfile.$LANGUAGE > Dockerfile
# pull the latest build
-
docker pull "$CI_REGISTRY_IMAGE:latest" ||
true
-
docker pull "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:latest" ||
true
# pull the latest build of the targeted versions
-
docker pull "$CI_REGISTRY_IMAGE:$VERSIONS_TAG" ||
true
-
docker pull "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:$VERSIONS_TAG" ||
true
# pull the latest build of the target R version in order to re-use it for the targeted SHINY_SERVER_VERSION
-
docker pull "$CI_REGISTRY_IMAGE:$R_VERSION" ||
true
-
docker pull "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:$R_VERSION" ||
true
# pull the latest build of main
-
docker pull "$CI_REGISTRY_IMAGE/main:latest" ||
true
-
docker pull "$CI_REGISTRY_IMAGE/
${LANGUAGE}/
main:latest" ||
true
# pull the latest build of this branch
-
docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest" ||
true
-
docker pull "$CI_REGISTRY_IMAGE/$
{LANGUAGE}/$
CI_COMMIT_REF_SLUG:latest" ||
true
# build the image while passing commit SHA and versions, and tagging the image with them
-
docker build
--build-arg R_VERSION
--build-arg SHINY_SERVER_VERSION
--cache-from "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
--cache-from "$CI_REGISTRY_IMAGE/main:latest"
--cache-from "$CI_REGISTRY_IMAGE:$VERSIONS_TAG"
--cache-from "$CI_REGISTRY_IMAGE:$R_VERSION"
--cache-from "$CI_REGISTRY_IMAGE:latest"
--tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
--tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
--tag "$CI_REGISTRY_IMAGE:$VERSIONS_TAG"
--tag "$CI_REGISTRY_IMAGE:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA"
--cache-from "$CI_REGISTRY_IMAGE/$
{LANGUAGE}/$
CI_COMMIT_REF_SLUG:latest"
--cache-from "$CI_REGISTRY_IMAGE/
${LANGUAGE}/
main:latest"
--cache-from "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:$VERSIONS_TAG"
--cache-from "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:$R_VERSION"
--cache-from "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:latest"
--tag "$CI_REGISTRY_IMAGE/$
{LANGUAGE}/$
CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
--tag "$CI_REGISTRY_IMAGE/$
{LANGUAGE}/$
CI_COMMIT_REF_SLUG:latest"
--tag "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:$VERSIONS_TAG"
--tag "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA"
-f Dockerfile
./
# push image as latest for the current branch
-
docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
-
docker push "$CI_REGISTRY_IMAGE/$
{LANGUAGE}/$
CI_COMMIT_REF_SLUG:latest"
# push image tagged with its sha
-
docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
-
docker push "$CI_REGISTRY_IMAGE/$
{LANGUAGE}/$
CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
-
|
if [ "main" == "${CI_COMMIT_REF_SLUG}" ]; then
# push image tagged with its versions
docker push "$CI_REGISTRY_IMAGE:$VERSIONS_TAG"
docker push "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:$VERSIONS_TAG"
# push image tagged with its versions and the commit sha (debug purpose)
docker push "$CI_REGISTRY_IMAGE:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA"
docker push "$CI_REGISTRY_IMAGE
/${LANGUAGE}
:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA"
fi
parallel
:
matrix
:
-
R_VERSION
:
[
"
latest"
]
# R_VERSION: ["3.6.3", "4.2.3", "latest"]
SHINY_SERVER_VERSION
:
[
"
latest"
]
LANGUAGE
:
[
"
r"
]
-
R_VERSION
:
[
"
latest"
]
# R_VERSION: ["3.6.3", "4.2.3", "latest"]
SHINY_SERVER_VERSION
:
[
"
latest"
]
LANGUAGE
:
[
"
python"
]
PYTHON_VERSION
:
[
"
3.9-slim-bullseye"
]
trigger_r_example
:
needs
:
[
"
build"
]
trigger
:
project
:
hub/rshiny-k8s-example
branch
:
base-r
trigger_
job
:
trigger_
python_example
:
needs
:
[
"
build"
]
trigger
:
project
:
hub/rshiny-k8s-example
branch
:
base-python
\ 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