Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FACT Data API Reader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FACT
FACT Utils
FACT Data API Reader
Commits
c61ea05f
Commit
c61ea05f
authored
6 months ago
by
Riccardo Boero
Browse files
Options
Downloads
Patches
Plain Diff
Fixing tag activated package registration
parent
9fbc0087
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci-release.yml
+20
-6
20 additions, 6 deletions
.gitlab-ci-release.yml
with
20 additions
and
6 deletions
.gitlab-ci-release.yml
+
20
−
6
View file @
c61ea05f
...
...
@@ -7,16 +7,31 @@ stages:
variables
:
GITLAB_REGISTRY_USER
:
$GITLAB_REGISTRY_USER
# GitLab registry user (CI/CD variable)
GITLAB_REGISTRY_PASS
:
$GITLAB_REGISTRY_PASS
# GitLab registry password/token (CI/CD variable)
PACKAGE_REPO
:
$CI_PROJECT_URL
# Dynamically get the package repo URL from GitLab CI's built-in variable
# Register the package in the registry using Registrator's Reg
Service
# Register the package in the registry using Registrator's Reg
isterParams and RegistryTools.register()
register
:
stage
:
register
script
:
-
julia --project=. -e '
using Pkg;
Pkg.add("Registrator");
using Registrator.RegService;
RegService.main(repo="https://git.nilu.no/julia/FACT_data_API_reader", branch="main", user=ENV["GITLAB_REGISTRY_USER"], token=ENV["GITLAB_REGISTRY_PASS"], registry="https://git.nilu.no/julia/registry")'
using Registrator;
using RegistryTools;
# Define package repository, branch, and tree SHA
package_repo = ENV["PACKAGE_REPO"]
# Use environment variable for the package repository URL
branch = "main"
# Fetch the project data
pkg = RegistryTools.Project("Project.toml")
# Path to your Project.toml in the package repo
tree_sha = readchomp(`git rev-parse HEAD`)
# Get the current commit hash (tree SHA)
# Create RegisterParams object
reg_params = Registrator.RegisterParams(package_repo, pkg, tree_sha; registry="https://git.nilu.no/julia/registry", registry_fork="https://git.nilu.no/julia/registry", push=true, gitconfig=Dict("user.name" => ENV["GITLAB_REGISTRY_USER"], "user.password" => ENV["GITLAB_REGISTRY_PASS"]))
# Call the register function
RegistryTools.register(reg_params)'
only
:
-
tags
...
...
@@ -29,8 +44,7 @@ deploy_release:
Pkg.add("TagBot");
ENV["GITLAB_USER"] = ENV["GITLAB_REGISTRY_USER"];
ENV["GITLAB_PASS"] = ENV["GITLAB_REGISTRY_PASS"];
TagBot.tag()'
TagBot.tag()
'
only:
-
tags
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