Git Product home page Git Product logo

ci-yml's Introduction

.ci.yml parser/runner for Gitlab-CI

image

The ci-yml utilities read the local .ci.yml file and run a series of action grouped under jobs.

The .ci.yml file may define a deploy job and a list of other parallel jobs that can be assigned 1-to-1 with the gitlab-CI test jobs.

This is a .ci.yml example file:

prepare:
  - <shell command>
  - <shell command>
jobs:
  <jobname>:
    - <shell command>
  <jobname>:
    - <shell command>
deploy:
  - <shell command>
  - <shell command>

In the example below we have two jobs, a prepare job used to install additional package:

prepare:
  - pip install pyyaml

jobs:
  test1:
    - python ./test1.py
  build_doc:
    - make doc

The commands inside prepare block are executed before that any other jobs is executed and the errors are ignored.

Following the example above you should configure two test jobs in you gitlab-ci instance and just call:

ci-yml test1 

and:

ci-yml build_doc

respectively. If you have also a deploy job you should also setup the gitlab-ci deploy job with the only command:

ci-yml deploy

If no arguments are provided to `ci-yml` all the jobs are executed until the first one fails or all jobs are runned than deploy action take place

Environment variables

ci-yml extend the env variables with the follows:

  • CI_YML_JOB

To see the gitlab environment variables see https://gitlab.com/gitlab-org/gitlab-ci/tree/master/doc/examples#environmental-variables Travis envs doc are available at http://docs.travis-ci.com/user/environment-variables/

You can also define extra env vars using the envs block, the newly defined vars can also combine other env vars. For example:

envs:
  pub_path: "/var/www/$USER/$CI_BUILD_REF"

...

deploy:
  - cp *.out $PUB_PATH

Note: For your convenience you can define the vars as lower case inside the envs block but they MUST be used upper case inside the command.

ci-yml and travis

This project was intended to supply a job configuration method to gitlab-ci that don't have any one atm, otherwise it could be useful also in others use cases.

You can use ci-yml locally during developing and you can also call it inside .travis.yml, see the local travis config file for info.

ci-yml's People

Contributors

claudyus avatar

Watchers

James Cloos avatar Philippe Ombredanne 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.