Giter VIP home page Giter VIP logo

pipedawg's Introduction

pipedawg

Gem Version

Generate GitLab CI pipelines.

Installation

Install pipedawg with:

gem install pipedawg

Or add this line to your application's Gemfile:

gem 'pipedawg'

And then execute:

bundle install

Ruby library

Example:

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'pipedawg'

gem_job = Pipedawg::Job.new(
  'build:gem',
  artifacts: ['*.gem'],
  image: 'ruby',
  script: ['bundle install', 'gem build *.gemspec']
)

kaniko_build_job = Pipedawg::Job::Kaniko::Build.new(
  'build:kaniko',
  needs: ['build:gem'],
  retry: 2,
  context:'${CI_PROJECT_DIR}/docker',
  external_files: {'*.gem':'gems'},
  debug: false
)

pipeline = Pipedawg::Pipeline.new 'build:image', jobs: [gem_job, kaniko_build_job]
puts pipeline.to_yaml
pipeline.to_yaml_file('/tmp/pipeline.yaml')
$ cat /tmp/pipeline.yaml 
---
stages:
- '1'
- '2'
build:gem:
  artifacts:
  - "*.gem"
  cache: {}
  image: ruby
  needs: []
  script:
  - bundle install
  - gem build *.gemspec
  stage: '1'
  tags: []
build:kaniko:
  artifacts: {}
  cache: {}
  image:
    entrypoint:
    - ''
    name: gcr.io/kaniko-project/executor:debug
  needs:
  - build:gem
  retry: 2
  script:
  - echo "{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}"
    > "/kaniko/.docker/config.json"
  - cp "*.gem" "${CI_PROJECT_DIR}/docker/gems"
  - '"/kaniko/executor" --context "${CI_PROJECT_DIR}/docker" --dockerfile "Dockerfile"
    --destination ${CI_REGISTRY_IMAGE}:latest'
  stage: '2'
  tags: []

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rake spec to run the tests. Run bundle exec rubocop to run the linter. You can also run bin/console for an interactive prompt that will allow you to experiment.

Note that by default, Bundler will attempt to install gems to the system, e.g. /usr/bin, /usr/share, which requires elevated access and can interfere with files that are managed by the system's package manager. This behaviour can be overridden by creating the file .bundle/config and adding the following line:

BUNDLE_PATH: "./.bundle"

When you run bin/setup or bundle install, all gems will be installed inside the .bundle directory of this project.

To make this behaviour a default for all gem projects, the above line can be added to the user's bundle config file in their home directory (~/.bundle/config)

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The gem is available as open source under the terms of the MIT License.

pipedawg's People

Contributors

liger1978 avatar valdrinbottomline avatar valdrinlushaj avatar

Stargazers

 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.