Skip to content
  • Arnaud Rebillout's avatar
    Use CI_COMMIT_REF_SLUG to derive image tag from branch name · 29a1be62
    Arnaud Rebillout authored
    When development of salsa-ci-pipeline is done on a branch, the images
    are tagged according to `CI_COMMIT_REF_NAME`. However the set of
    characters allowed for a git ref name is wider than the set of
    characters allowed for a image tag, so some branch names fail the
    pipeline. For example, with a branch named `wip/apt-details`:
    
    ```
    $ buildah build [...]
    Error: tag base:sid_wip/apt-details: invalid reference format
    ```
    
    The `/` is a commonly-used character in Git branch names (I personally
    use it all the time), but it's not the only one, eg. `+` or `@` are
    allowed in git branch names, but will fail the pipeline all the same.
    
    It looks like the set of characters allowed for a image tag is defined
    at <https://docs.docker.com/reference/cli/docker/image/tag/>:
    
    > The tag must be valid ASCII and can contain lowercase and uppercase
    > letters, digits, underscores, periods, and hyphens.
    
    It turns out that GitLab already has a pre-defined variable that fits
    t...
    29a1be62
After you've reviewed these contribution guidelines, you'll be all set to contribute to this project.
Loading