Skip to content
Snippets Groups Projects
Commit 0f9b712f authored by Riccardo Boero's avatar Riccardo Boero :innocent:
Browse files

Fixing nested ci-cd jobs

parent 61ce2495
No related branches found
No related tags found
No related merge requests found
image: julia:latest
stages:
- test
- register
- deploy
- deploy_release # Rename this stage to avoid conflict with the deploy stage in .gitlab-ci.yml
# Define the environment variables for authentication
variables:
GITLAB_REGISTRY_USER: $GITLAB_REGISTRY_USER # Username token
GITLAB_REGISTRY_PASS: $GITLAB_REGISTRY_PASS # Password token
# Test stage
test:
stage: test
script:
- julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.test()'
GITLAB_REGISTRY_USER: $GITLAB_REGISTRY_USER
GITLAB_REGISTRY_PASS: $GITLAB_REGISTRY_PASS
# Register the package in the registry
register:
......@@ -24,21 +16,21 @@ register:
using Pkg;
Pkg.add("Registrator");
using Registrator;
ENV["GITLAB_USER"] = ENV["GITLAB_REGISTRY_USER"]
ENV["GITLAB_PASS"] = ENV["GITLAB_REGISTRY_PASS"]
ENV["GITLAB_USER"] = ENV["GITLAB_REGISTRY_USER"];
ENV["GITLAB_PASS"] = ENV["GITLAB_REGISTRY_PASS"];
Registrator.register(RegistrySpec(name="NILURegistry", url="https://git.nilu.no/julia/registry.git"))'
only:
- tags
# Deploy the package (tag-based release)
deploy:
stage: deploy
deploy_release:
stage: deploy_release # Using the new stage name to avoid conflicts
script:
- julia --project=. -e '
using Pkg;
Pkg.add("TagBot");
ENV["GITLAB_USER"] = ENV["GITLAB_REGISTRY_USER"]
ENV["GITLAB_PASS"] = ENV["GITLAB_REGISTRY_PASS"]
ENV["GITLAB_USER"] = ENV["GITLAB_REGISTRY_USER"];
ENV["GITLAB_PASS"] = ENV["GITLAB_REGISTRY_PASS"];
TagBot.tag()'
only:
- tags
......
......@@ -3,7 +3,10 @@ image: julia:latest
stages:
- documentation
- deploy
- register # Declare the stage from .gitlab-ci-release.yml
- deploy_release # Differentiate release deploy from pages deploy
# Existing jobs for documentation and pages
build documentation:
stage: documentation
script:
......@@ -26,6 +29,7 @@ pages:
only:
- main
# Include release-specific jobs from another YAML file
# Include the release-specific YAML file
include:
- local: .gitlab-ci-release.yml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment