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

Custom build directories with GIT_CLONE_PATH #1207

Open
staehle opened this issue May 7, 2024 · 3 comments
Open

Custom build directories with GIT_CLONE_PATH #1207

staehle opened this issue May 7, 2024 · 3 comments
Labels
nice Down prioritized

Comments

@staehle
Copy link

staehle commented May 7, 2024

Is your feature request related to a problem? Please describe.
Hi! Love this project, however it does not currently work with my GitLab projects where GIT_CLONE_PATH is set, as CI builds in those repos are where they're just a piece of a larger puzzle and I have to clone other items directly in CI_PROJECT_PATH. Basically it just allows the GitLab project being CI'd to start off in a subdirectory.

Describe the solution you'd like
Pretty much just what the GitLab docs state for it:

It just clones the GitLab project into the provided GIT_CLONE_PATH directory instead of the default.

Describe alternatives you've considered
Other than manually moving items around, which I'm not too keen on doing.

Additional context
Not really, just letting you know this is a feature that's missing! Thanks! :)

@staehle
Copy link
Author

staehle commented May 8, 2024

On a similar note, CI_BUILDS_DIR is missing. It looks like CI_PROJECT_DIR here is taking it's place, which is not particularly working well for my case of needing to orchestrate multiple repos for a single CI run.

For example on a real GitLab CI run, these are the builtin variables I get:

CI_PROJECT_PATH: firmware/myproject
CI_BUILDS_DIR: /builds
CI_PROJECT_DIR: /builds/firmware/myproject # aka "${CI_BUILDS_DIR}/${CI_PROJECT_PATH}" , at least in my runner setup

And "myproject" is a subcomponent of what we'll call the "super_project", so I need to do a directory shuffle in order to do a build, like so:

variables:
  SUPER_PROJECT_DIR: ${CI_PROJECT_DIR}/super_project  # /builds/firmware/myproject/super_project
  ACTUAL_PROJECT_DIR: ${SUPER_PROJECT_DIR}/myproject  # /builds/firmware/myproject/super_project/myproject
  ARTIFACTS_DIR: ${CI_PROJECT_DIR}/artifacts
script:
  - |
    cd ${CI_BUILDS_DIR}
    mv ${CI_PROJECT_DIR} ${CI_BUILDS_DIR}/tempspace
    mkdir -p ${CI_PROJECT_DIR}
    git clone --depth=1 https://oauth2:${GL_TOKEN}@... ${SUPER_PROJECT_DIR}
    mv ${CI_BUILDS_DIR}/tempspace ${ACTUAL_PROJECT_DIR}
    cd ${ACTUAL_PROJECT_DIR}
    ./do_the_build destination=${ARTIFACTS_DIR}

I can't currently do script step 2 with gitlab-ci-local. So even without GIT_CLONE_PATH support, a workaround like this wouldn't work either

@firecow
Copy link
Owner

firecow commented May 9, 2024

CI_BUILDS_ variables was deprecated in Gitlab 9.0, we will most likely not be implementing variables that are so old.
https://gitlab.com/gitlab-org/gitlab/-/issues/352957

@firecow firecow added the nice Down prioritized label May 9, 2024
@staehle
Copy link
Author

staehle commented May 9, 2024

CI_BUILD_*, non-plural, yes. CI_BUILDS_DIR is noted as not being deprecated in the very ticket you linked 😅

CI_BUILDS_DIR wouldn't be here otherwise https://docs.gitlab.com/ee/ci/variables/predefined_variables.html , or in various other current docs https://docs.gitlab.com/search/?q=CI_BUILDS_DIR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice Down prioritized
Projects
None yet
Development

No branches or pull requests

2 participants