Skip to content

Commit

Permalink
feat: Initialize the new orb template repo
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleTryon committed Mar 7, 2022
0 parents commit f33e6e4
Show file tree
Hide file tree
Showing 16 changed files with 329 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2.1
setup: true
orbs:
orb-tools: circleci/[email protected]
shellcheck: circleci/[email protected]

workflows:
lint-pack:
jobs:
- orb-tools/lint
- orb-tools/pack
- orb-tools/review
- shellcheck/check:
exclude: SC2148,SC2038,SC2086,SC2002,SC2016
- orb-tools-/publish-dev:
orb-name: <namespace>/<orb-name>
requires:
[
orb-tools/lint,
orb-tools/review,
orb-tools/pack,
shellcheck/check,
]
# Use a context to hold your publishing token.
context: <publishing-context>
# Triggers the next workflow in the Orb Development Kit.
- orb-tools-/continue:
pipeline-number: << pipeline.number >>
vcs-type: << pipeline.project.type >>
requires: [orb-tools-/publish-dev]
32 changes: 32 additions & 0 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2.1
orbs:
<orb-name>: <namespace>/<orb-name>@dev:<<pipeline.git.revision>>
orb-tools: circleci/[email protected]

workflows:
test-deploy:
jobs:
- orb-tools-alpha/lint:
filters:
tags:
only: /.*/
- orb-tools-alpha/pack:
filters:
tags:
only: /.*/
- orb-tools-alpha/review:
filters:
tags:
only: /.*/
- orb-tools-alpha/publish-release:
orb-name: <namespace>/<orb-name>
requires:
- orb-tools-alpha/lint
- orb-tools-alpha/review
- orb-tools-alpha/pack
context: <publishing-context>
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "\U0001F41E Bug Report"
description: Report any identified bugs.
title: 'Bug: '
labels: [bug]
# assignees: ''
body:
- type: checkboxes
attributes:
label: "Is there an existing issue for this?"
description: "Please search [here](https://github.com/<organization>/<project-name>/issues?q=is%3Aissue) to see if an issue already exists for the bug you encountered"
options:
- label: "I have searched the existing issues"
required: true

- type: input
attributes:
label: "Orb version"
description: |
Which version of `<namespace>/<orb-name>` are you using?
placeholder: "1.0.0"

- type: textarea
validations:
required: true
attributes:
label: "Current behavior"
description: "How does the issue manifest?"

- type: textarea
validations:
required: true
attributes:
label: "Minimum reproduction config"
description: "Enter a URL to a failed build or write a config example to reproduce the issue"
placeholder: "https://app.circleci.com/..."

- type: textarea
attributes:
label: "Other"
description: |
Anything else you want to share?
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "\U0001F4A1 Feature Request"
description: Have an idea for a new feature? Begin by submitting a Feature Request
title: 'Request: '
labels: [enhancement]
# assignees: ''
body:
- type: checkboxes
attributes:
label: "Is there an existing issue that is already proposing this?"
description: "Please search [here](https://github.com/CircleCI-Public/circleci-config-sdk-ts/issues?q=is%3Aissue) to see if an issue already exists for the feature you are requesting"
options:
- label: "I have searched the existing issues"
required: true

- type: textarea
validations:
required: true
attributes:
label: "Describe the problem imposed by not having this feature"
description: "Please describe the use-case you are attempting to implement, and the current limitations you are facing."

- type: textarea
validations:
required: true
attributes:
label: "Describe the solution you'd like"
description: "A clear and concise description of what you want to happen. Add any considered drawbacks"


- type: textarea
attributes:
label: "Other"
description: |
Anything else you want to share?
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/PULL_REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## PR Type
What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting)
- [ ] Refactoring (no functional changes)
- [ ] CI related changes
- [ ] Other... Please describe:

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: N/A

## What is the new behavior?

## Does this PR introduce a breaking change?
- [ ] Yes
- [ ] No

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->

## Other information
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# orb.yml is "packed" from source, and not published directly from the repository.
orb.yml
.DS_Store
7 changes: 7 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: relaxed

rules:
line-length:
max: 200
allow-non-breakable-inline-mappings: true

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 <organization>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Orb Template

<!---
[![CircleCI Build Status](https://circleci.com/gh/<organization>/<project-name>.svg?style=shield "CircleCI Build Status")](https://circleci.com/gh/<organization>/<project-name>) [![CircleCI Orb Version](https://badges.circleci.com/orbs/<namespace>/<orb-name>.svg)](https://circleci.com/orbs/registry/orb/<namespace>/<orb-name>) [![GitHub License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/<organization>/<project-name>/master/LICENSE) [![CircleCI Community](https://img.shields.io/badge/community-CircleCI%20Discuss-343434.svg)](https://discuss.circleci.com/c/ecosystem/orbs)
--->

A project template for Orbs.

This repository is designed to be automatically ingested and modified by the CircleCI CLI's `orb init` command.

_**Edit this area to include a custom title and description.**_

---

## Resources

[CircleCI Orb Registry Page](https://circleci.com/orbs/registry/orb/<namespace>/<orb-name>) - The official registry page of this orb for all versions, executors, commands, and jobs described.

[CircleCI Orb Docs](https://circleci.com/docs/2.0/orb-intro/#section=configuration) - Docs for using, creating, and publishing CircleCI Orbs.

### How to Contribute

We welcome [issues](https://github.com/<organization>/<project-name>/issues) to and [pull requests](https://github.com/<organization>/<project-name>/pulls) against this repository!

### How to Publish An Update
1. Merge pull requests with desired changes to the main branch.
- For the best experience, squash-and-merge and use [Conventional Commit Messages](https://conventionalcommits.org/).
2. Find the current version of the orb.
- You can run `circleci orb info <namespace>/<orb-name> | grep "Latest"` to see the current version.
3. Create a [new Release](https://github.com/<organization>/<project-name>/releases/new) on GitHub.
- Click "Choose a tag" and _create_ a new [semantically versioned](http://semver.org/) tag. (ex: v1.0.0)
- We will have an opportunity to change this before we publish if needed after the next step.
4. Click _"+ Auto-generate release notes"_.
- This will create a summary of all of the merged pull requests since the previous release.
- If you have used _[Conventional Commit Messages](https://conventionalcommits.org/)_ it will be easy to determine what types of changes were made, allowing you to ensure the correct version tag is being published.
5. Now ensure the version tag selected is semantically accurate based on the changes included.
6. Click _"Publish Release"_.
- This will push a new tag and trigger your publishing pipeline on CircleCI.
15 changes: 15 additions & 0 deletions src/@orb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2.1

description: >
Sample orb description
# What will your orb allow users to accomplish?
# Descriptions should be short, simple, and informative.

# This information will be displayed in the orb registry and is not mandatory.
display:
home_url: "https://www.example.com/docs"
source_url: "https://www.github.com/<organization>/<project-name>"

# If your orb requires other orbs, you can import them like this. Otherwise remove the "orbs" stanza.
# orbs:
# hello: circleci/[email protected]
26 changes: 26 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Orb Source

Orbs are shipped as individual `orb.yml` files, however, to make development easier, it is possible to author an orb in _unpacked_ form, which can be _packed_ with the CircleCI CLI and published.

The default `.circleci/config.yml` file contains the configuration code needed to automatically pack, test, and deploy and changes made to the contents of the orb source in this directory.

## @orb.yml

This is the entry point for our orb "tree", which becomes our `orb.yml` file later.

Within the `@orb.yml` we generally specify 4 configuration keys

**Keys**

1. **version**
Specify version 2.1 for orb-compatible configuration `version: 2.1`
2. **description**
Give your orb a description. Shown within the CLI and orb registry
3. **display**
Specify the `home_url` referencing documentation or product URL, and `source_url` linking to the orb's source repository.
4. **orbs**
(optional) Some orbs may depend on other orbs. Import them here.

## See:
- [Orb Author Intro](https://circleci.com/docs/2.0/orb-author-intro/#section=configuration)
- [Reusable Configuration](https://circleci.com/docs/2.0/reusing-config)
15 changes: 15 additions & 0 deletions src/commands/greet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
description: >
This command echos "Hello World" using file inclusion.
# What will this command do?
# Descriptions should be short, simple, and clear.
parameters:
to:
type: string
default: "World"
description: "Hello to whom?"
steps:
- run:
environment:
PARAM_TO: <<parameters.to>>
name: Hello Greeting
command: <<include(scripts/greet.sh)>>
13 changes: 13 additions & 0 deletions src/examples/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: >
Sample example description.
# Provide a use-case based example for using this orb.
# Everything in the `usage` section will be displayed in the orb registry.
# Comments are not retained.
usage:
version: 2.1
orbs:
<orb-name>: <namespace>/<orb-name>@1.2.3
workflows:
use-my-orb:
jobs:
- <orb-name>/<job-name>
12 changes: 12 additions & 0 deletions src/executors/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: >
This is a sample executor using Docker and Node. If you want to provide a custom environment in your orb, insert your image here.
If you do not require an executor, you can simply delete this directory.
docker:
- image: 'cimg/node:<<parameters.tag>>'
parameters:
tag:
default: lts
description: >
Pick a specific cimg/node image variant:
https://hub.docker.com/r/cimg/node/tags
type: string
14 changes: 14 additions & 0 deletions src/jobs/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: >
Sample description
# What will this job do?

executor: default

parameters:
to:
type: string
default: "World"
description: "Hello to whom?"
steps:
- greet:
to: << parameters.to >>
2 changes: 2 additions & 0 deletions src/scripts/greet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
echo Hello "${PARAM_TO}"

0 comments on commit f33e6e4

Please sign in to comment.