Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Semantic Release
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
CI-CD components
Semantic Release
Commits
1fc7b1ac
Commit
1fc7b1ac
authored
9 months ago
by
Pytgaen
Browse files
Options
Downloads
Patches
Plain Diff
fix: npm cache and add yq cache
parent
aed4c490
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/gitlab-ci-semrel.yml
+25
-5
25 additions, 5 deletions
templates/gitlab-ci-semrel.yml
with
25 additions
and
5 deletions
templates/gitlab-ci-semrel.yml
+
25
−
5
View file @
1fc7b1ac
...
...
@@ -611,10 +611,20 @@ stages:
yq_version=$(github_get_latest_version mikefarah/yq)
yq_binary=yq_linux_amd64
yq_url="https://github.com/mikefarah/yq/releases/download/${yq_version}/${yq_binary}.tar.gz"
log_info "Download latest yq version: \\e[32m$yq_url\\e[0m"
download_file "${yq_url}" "${yq_binary}.tar.gz"
tar xvf "${yq_binary}.tar.gz"
mv "${yq_binary}" /usr/bin/yq
yq_cache="$XDG_CACHE_HOME/yq-$(echo "$yq_url" | md5sum | cut -d" " -f1)"
if [[ -f "$yq_cache" ]]
then
log_info "yq found in cache: reuse"
else
log_info "yq not found in cache: download"
log_info "Download latest yq version: \\e[32m$yq_url\\e[0m"
download_file "${yq_url}" "${yq_binary}.tar.gz"
tar xvf "${yq_binary}.tar.gz"
mkdir -p "$XDG_CACHE_HOME"
mv "${yq_binary}" "$yq_cache"
fi
ln -s "$yq_cache" /usr/bin/yq
fi
}
...
...
@@ -745,11 +755,21 @@ stages:
-
cd "${SEMREL_CONFIG_DIR}"
-
prepare_semantic_release
-
install_semantic_release_plugins
variables
:
# download cache
XDG_CACHE_HOME
:
"
$CI_PROJECT_DIR/.cache"
# NPM cache
npm_config_cache
:
"
$CI_PROJECT_DIR/.npm"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache
:
# cache shall be per branch per template
key
:
"
$CI_COMMIT_REF_SLUG-SEMREL"
when
:
always
paths
:
-
.npm/
-
"
$CI_PROJECT_DIR/.npm"
-
"
$XDG_CACHE_HOME"
semantic-release-info
:
extends
:
.semrel-base
...
...
This diff is collapsed.
Click to expand it.
Benguria Elguezabal, Gorka
@gorka.benguria
mentioned in commit
c897bed2
·
8 months ago
mentioned in commit
c897bed2
mentioned in commit c897bed2cc5269ee5274d6c6258f47dd1b8257da
Toggle commit list
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