Git Product home page Git Product logo

gitlab-release's Introduction

IMPORTANT: If you are viewing this on GitHub, you are viewing a mirror of the GitLab project.

GitLab Release

This is a simple bash script designed to run in GitLab CI when tags are pushed to a project to create a release if it does not exist and upload files against the release.

Overview

The idea is very simple, specify a path where release files are located (via GR_RELEASE_PATH env var ) that need to be uploaded against a release. Then define a publish files/binaries job in your .gitlab-ci.yml file and sit back and watch your release assets get published automatically when you push a tag.

Caveats

Unfortunately the CI_JOB_TOKEN does not have enough privileges at this time to allow upload of assets or to create a release, so you will need to specify one from an account that has high privileges via the GR_TOKEN env var in your GitLab CI/CD Settings for the Project or Group that the project belongs to.

Usage

This is designed to be run as a docker container with GitLab CI.

GitLab CI Example Job

publish:binaries:
  stage: publish
  image: ekristen/gitlab-release:latest
  dependencies:
    - some-previous-job-that-has-artifacts
  variables:
    GIT_STRATEGY: none
  script:
    - gitlab-release
  only:
    refs:
      - tags

Development

You can mimic the GitLab CI environment by ensuring all the necessary env vars are set. Specifically GR_TOKEN, CI_PROJECT_ID and CI_COMMIT_TAG. If you wish to debug the script, simply set DEBUG to any value.

gitlab-release's People

Contributors

ekristen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.