GithubHelp home page GithubHelp logo

tzemanovic / gitlab-ci-local Goto Github PK

View Code? Open in Web Editor NEW

This project forked from firecow/gitlab-ci-local

0.0 1.0 0.0 45.33 MB

Test you gitlab ci locally, with local overrides.

License: Apache License 2.0

TypeScript 99.62% Shell 0.38%

gitlab-ci-local's Introduction

Introduction

Are you tired of pushing commits to test your Gitlab CI?

Then this is the tool for you.

It lets you simulate a CI pipeline on your local machine.

Table of contents

Installation

Linux

Download and put binary in /usr/local/bin

$ sudo su # must be installed as root, if placed in /usr/local/bin/
$ curl -L https://github.com/firecow/gitlab-ci-local/releases/latest/download/linux.gz | gunzip -c > /usr/local/bin/gitlab-ci-local
$ chmod +x /usr/local/bin/gitlab-ci-local
$ exit

Windows (Git bash)

Install gitbash

Download and put binary in C:\Program Files\Git\mingw64\bin

$ curl -L https://github.com/firecow/gitlab-ci-local/releases/latest/download/win.gz | gunzip -c > /c/Program\ Files/Git/mingw64/bin/gitlab-ci-local.exe

Macos

Download and put binary in /usr/local/bin

$ sudo su # must be installed as root, if placed in /usr/local/bin/
$ curl -L https://github.com/firecow/gitlab-ci-local/releases/latest/download/macOS.gz | gunzip -c > /usr/local/bin/gitlab-ci-local
$ chmod +x /usr/local/bin/gitlab-ci-local
$ exit

Usage

Example

$ cd /home/user/workspace/myproject
$ gitlab-ci-local

Convinience

Bash alias

$ echo "alias gcl='gitlab-ci-local'" >> ~/.bashrc

Bash completion

Add this to ~/.bashrc

_yargs_completions()
{
    local cur_word args type_list

    cur_word="${COMP_WORDS[COMP_CWORD]}"
    args=("${COMP_WORDS[@]}")

    # ask yargs to generate completions.
    type_list=$(/usr/local/bin/gitlab-ci-local --get-yargs-completions "${args[@]}")

    COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )

    # if no match was found, fall back to filename completion
    if [ ${#COMPREPLY[@]} -eq 0 ]; then
      COMPREPLY=()
    fi

    return 0
}
complete -o default -F _yargs_completions gitlab-ci-local

Quirks

Artifacts

Artifacts works right now, as along as you don't overwrite tracked files.

Development

Scripts

$ npm install
$ npm run build
$ node -r source-map-support/register dist/index.js --cwd /home/user/workspace/project-folder/

Alt text

Package binaries

$ npm run pkg-linux
$ npm run pkg-win
$ npm run pkg-macos
$ npm run pkg-all

TODO

Unsupported tags, will be implemented in order

  • rules
  • environment
  • when:always
  • when:on_failure
  • when:delayed
    • start_in (Used only with when:delayed)
  • include:template
  • include:remote
  • coverage (code coverage)
  • retry (in case of failure)
  • timeout (job max execution time)

Docker specfic tags. (Only shell working now)

  • services
  • image

Will not be implemented

  • cache
  • pages
  • resource_group
  • interruptible

Undecided

  • artifacts (reset/restore/uploads "files" from job to job)
  • dependencies (depend or non-depend on artifacts, default is depend ALL)
  • only
  • except
  • parallel
  • trigger

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.