orginux / gitlab-tool

WIP: GitLab-tool is created for embedded into CI/CD process [Mirror]

Home Page:https://gitlab.com/orginux/gitlab-tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gitlab-tool

Util for interact with GitLab for use in CI or in command line.

Examples

Download artifacts

If need download artifacts from an external project set GITLAB_PRIVATE_TOKEN in GitLab variables and project and job to download. Download all artifacts for job:

...
download all:
  stage: download
  image: gitlab-tool:latest
  script:
    - gitlab-tool download
        --project-id $EXT_PROJECT
        --destination local_path/
        --job-name $EXT_JOB_NAME
        --create-dirs
        --extract
    - ls -l local_path/
...

For single file:

...
single file:
  stage: download
  image: gitlab-tool:latest
  script:
    - gitlab-tool download
        --project-id $EXT_PROJECT
        --destination local_path/
        --job-name $EXT_JOB_NAME
        --create-dirs
        --file-name $EXT_FILE_NAME
    - cat local_path/${EXT_FILE_NAME}
...

Get list commints

gitlab-tool --token $API_TOKEN --project-id $PROJECT_ID commit list

output:

Commit: <commit hash>
Autor: <autor name> <autor email>
Date: <date>
Message: <commit message>
WebURL: <commit url>

About

WIP: GitLab-tool is created for embedded into CI/CD process [Mirror]

https://gitlab.com/orginux/gitlab-tool


Languages

Language:Go 98.0%Language:Dockerfile 1.6%Language:Makefile 0.4%