ktomk / pipelines

Pipelines - Run Bitbucket Pipelines Wherever They Dock
https://ktomk.github.io/pipelines/
GNU Affero General Public License v3.0
109 stars 10 forks source link

BITBUCKET_REPO_SLUG holds the `.git` extension #19

Closed Timple closed 2 years ago

Timple commented 2 years ago

In the bitbucket pipelines the BITBUCKET_REPO_SLUG does not hold the .git extension.

It's an inconsistency, but it's not documented anywhere by atlassian that is should not or cannot hold the .git extension.

ktomk commented 2 years ago

Can you give an example when pipelines has .git in BITBUCKET_REPO_SLUG? Or please clarify what the report is about. @Timple

Timple commented 2 years ago
image: ubuntu
pipelines:
  default:
    - step:
        script:
          - echo "$BITBUCKET_REPO_SLUG"

Typically a repository url looks like this: https://bitbucket.org/company/somereponame

bitbucket pipelines: BITBUCKET_REPO_SLUG=somereponame

pipelines.phar: BITBUCKET_REPO_SLUG=somereponame.git

ktomk commented 2 years ago

@Timple Could it be that you project is inside a folder named somereponame.git? Pipelines should take the basename of the project folder (which is also the project name for it which then goes into the slug).

Timple commented 2 years ago

Aha, that might be it! They are not in a folder with the .git extension but they are symlink. And the symlinks (with extension) point to a folder with extension.

So this might be something we need to fix on our side.

ktomk commented 2 years ago

Ah, that explains it. If you want to have the same behaviour as on Bitbucket, you can add an entry to the .env.dist file specifying it. pipelines then takes that automatically into the runner-environment of the pipeline:

.env.dist

BITBUCKET_REPO_SLUG=somereponame

See as well Pipelines Environment Variable Usage.

Timple commented 2 years ago

Awesome, thanks for the pointer