Git Product home page Git Product logo

orb-tools-orb's Introduction

Orb Tools Orb CircleCI status CircleCI Orb Version GitHub license CircleCI Community

An orb for orb authors - provides a full suite of jobs for packing, validating, reviewing, testing and deploying your orbs to the orb registry.

Usage

The orb-tools orb is a key component of the "Orb Development Kit". For the full documentation for developing orbs, see the Intro to Authoring an Orb documentation.

When you initialize a new orb project using the Orb Development Kit, a customized .circleci/config.yml file is created containing a full CI pipeline for building, testing, and publishing your orb which utilizes the "orb-tools" orb for the majority of these functions. You can find the config template here.

Once automatically configured, on each code push to your repo, CircleCI will trigger the pipeline defined in the .circleci/config.yml file, which will execute (among several others) the orb-tools orb's jobs.

When you are ready to publish a new version of your orb, you can create a new release on GitHub and/or push a semantically versioned tag.

Quick Docs

Migrate From Older Orb Tools Versions

Follow the migration guide.

Local Usage

A subset of the orb-tools orb jobs and scripts can be ran locally. It is useful to be able to lint, shellcheck, and review your orbs locally, before committing. With this setup, it is possible to test your code locally, but integration tests of the built orb will be ran on CircleCI.

Local Linting

The orb-tools orb's orb-tools/lint job uses a utility yamllint, which can be downloaded an ran locally, or you can invoke the job locally with the CircleCI CLI.

Assuming you ./circleci/config.yml file appears similar to the one in this repository, you will have imported the orb-tools orb and defined the orb-tools/lint job in a workflow. Using the CLI from this directory, use the following command to locally lint your orb:

CircleCI Local Linting

$ circleci local execute --job orb-tools/lint

YamlLint Local Linting

$ yamllint ./src

Note: you will need a .yamllint file in the current directory to run the yamllint command. This will also be generated for you by the Orb Development Kit. Preview the file in the Orb Project Template.

Local Shellcheck

Shellcheck is a static analysis tool for shell scripts, and behaves like a linter for our shell scripts. Which of course can also be ran locally, or if defined within your configuration file, you can invoke the job locally with the CircleCI CLI.

CircleCI Local Shellcheck

$ circleci local execute --job shellcheck/check

You can not however pass in parameters to skip specific checks. Use the Shellcheck CLI locally for more control when running locally.

Shellcheck CLI Local Shellcheck

$ shellcheck ./src/scripts/*.sh --exclude SC2148,SC2038,SC2086,SC2002,SC2016

Local Review

The review job is a suite of Bash unit tests written using bats-core, a test automation framework for Bash. Each test focuses on checking for a best practice in the orb. The tests can be executed directly with the bats CLI, or you can invoke the job locally with the CircleCI CLI.

CircleCI Local Review

$ circleci local execute --job orb-tools/review

Note: You will always see a failure at the end of this job when ran locally because the job contains a step to upload test results to CircleCI.com, which is not supported in the local agent.

Bats CLI Review

You can also install the bats-core package locally and run the tests with the bats CLI.

$ bats ./src/scripts/review.bats

Contributing

We welcome issues to and pull requests against this repository!

For further questions/comments about this or other orbs, visit CircleCI's orbs discussion forum.

orb-tools-orb's People

Contributors

iynere avatar kyletryon avatar lokst avatar ndintenfass avatar bradylill avatar eddiewebb avatar circlecai avatar ericribeiro avatar jaryt avatar nise-nabe avatar lukesmith avatar surecloud-meason avatar chilipp avatar robzr avatar roopakv avatar sugarshin avatar particleflux avatar masutaka avatar burukuru avatar wyardley avatar yaningo avatar killianhmyd avatar kelvintaywl avatar juanca avatar jrnail23 avatar zzamboni avatar clementlecorre avatar cfra avatar cayennes avatar bharatr21 avatar

Watchers

 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.