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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub
shiny-k8s
Commits
a11a987b
Commit
a11a987b
authored
2 years ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
use cache in my-r-base
parent
c8e617a5
No related branches found
No related tags found
1 merge request
!9
Draft: split build in multiple stage
Pipeline
#102180
failed
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+6
-1
6 additions, 1 deletion
.gitlab-ci.yml
with
6 additions
and
1 deletion
.gitlab-ci.yml
+
6
−
1
View file @
a11a987b
...
...
@@ -43,11 +43,16 @@ build-my-r-base:
script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# pull the previous stage
-
docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/my-base:
$CI_COMMIT_SHA
"
-
docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/my-base:
latest
"
# pull the latest build of the target R version in order to re-use it
-
docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$R_VERSION" ||
true
# pull the latest build of the target R version in order to re-use it
-
docker pull "$CI_REGISTRY_IMAGE:$R_VERSION" ||
true
# building
-
docker build
--cache-from "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/my-base:latest"
--cache-from "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$R_VERSION"
--cache-from "$CI_REGISTRY_IMAGE:$R_VERSION"
--build-arg R_VERSION
--tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/${STAGE_NAME}/${R_VERSION}:$CI_COMMIT_SHA"
--file Dockerfile
...
...
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