Giter Site home page Giter Site logo

gitlab-pipelines's Introduction

GitLab CI YAML files containing useful template pipelines

As we built out the GitLab CI infrastructure for pyQuil and the Forest SDK, soon there was a lot of repeated YAML code so that each individual repository could run Python- or Lisp-based tests, and produce Docker images for all commits, pull requests, and releases. Fortunately, GitLab CI YAMLs contain the useful include and extends keywords, which allow for template jobs to be defined in separate files, and for the jobs in individual project YAMLs to inherit from them. Therefore, this repository was created to house these template YAMLs.

To take advantage of the Docker-related job templates, add the following to the top of the gitlab-ci.yml for the target repository:

include:
  - project: rigetti/forest/gitlab-pipelines
    file: docker.gitlab-ci.yml

NOTE: There is an additional forest directory included in the project path, as the GitLab mirror version of the repository is used by the include keyword.

To use the Docker-related templates (.docker-branch, .docker-edge, .docker-stable), add the following entries to the YAML:

docker-branch:
  extends: .docker-branch

docker-edge:
  extends: .docker-edge

docker-stable:
  extends: .docker-stable

In addition to providing those job entries, the jobs themselves depend on the existence of an IMAGE variable to operate correctly. This name of the desired Docker image, which will be built as part of the CI pipeline. For example, pyQuil has the following variables:

variables:
  IMAGE: rigetti/forest

To also take advantage of the Python-related job templates, add the following additional entry to the include section of the gitlab-ci.yml:

include:
  - project: rigetti/forest/gitlab-pipelines
    file: docker.gitlab-ci.yml
  - project: rigetti/forest/gitlab-pipelines
    file: python.gitlab-ci.yml

The .python template pulls out the shared installation commands into a before_script section, and assumes that your project has a Makefile with install and requirements targets defined. See the Makefile in the pyQuil project for more information.

gitlab-pipelines's People

Contributors

karalekas avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.