Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup with Gitlab advice #99

Open
samshupac opened this issue Apr 8, 2024 · 1 comment
Open

Setup with Gitlab advice #99

samshupac opened this issue Apr 8, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@samshupac
Copy link

samshupac commented Apr 8, 2024

For anyone else searching for how to setup Harbor on Gitlab CI this should be useful.
(Based on a pipeline initiated from the merge request context and having Gitlab setup as a Git provider in Forge)

harbor-provision-staging-site:
  stage: deploy
  variables:
    FORGE_TOKEN: XXXXX
    FORGE_SERVER: XXXXX
    FORGE_GIT_PROVIDER: gitlab # <-- This is critical and not documented currently
    FORGE_GIT_REPOSITORY: $CI_MERGE_REQUEST_PROJECT_PATH
    FORGE_GIT_BRANCH: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
    FORGE_DOMAIN: XXXXX
    FORGE_DEPLOY_SCRIPT: "git pull origin $$FORGE_SITE_BRANCH;"
  dependencies: []
  rules:
    - if: $CI_MERGE_REQUEST_PROJECT_PATH != '' # ensures the job only runs in merge request context
      when: manual
  image: kirschbaumdevelopment/laravel-test-runner:8.1
  script:
    # Install Harbor via Composer
    - composer global require mehrancodes/laravel-harbor -q
    # Start Provisioning
    - harbor provision

Note: the escaped variables with double dollar symbols in the the FORGE_DEPLOY_SCRIPT

@mehrancodes
Copy link
Owner

mehrancodes commented Apr 9, 2024

Thanks a bunch for giving it a go with GitLab! I'll make sure to include FORGE_GIT_PROVIDER in the docs soon.

Having this example documented would be super helpful for folks looking to use Harbor with GitLab. I take care of it soon. Appreciate your help!

@mehrancodes mehrancodes added the enhancement New feature or request label Apr 14, 2024
@mehrancodes mehrancodes self-assigned this Apr 14, 2024
@mehrancodes mehrancodes added the documentation Improvements or additions to documentation label Jul 21, 2024
@mehrancodes mehrancodes assigned RealMrHex and unassigned mehrancodes Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants