Skip to content

Commit

Permalink
Update orb-tools and integrate new orb template content (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
zigarn authored Mar 21, 2023
1 parent 82ed460 commit 99b9281
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 225 deletions.
33 changes: 0 additions & 33 deletions .circleci/README.md

This file was deleted.

86 changes: 24 additions & 62 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,33 @@
version: 2.1

setup: true
orbs:
ztraining2strigo: zenika-training/ztraining2strigo@<<pipeline.parameters.dev-orb-version>>
orb-tools: circleci/[email protected]
orb-tools: circleci/[email protected]

# Pipeline Parameters
## These parameters are used internally by orb-tools. Skip to the Jobs section.
parameters:
run-integration-tests:
description: An internal flag to prevent integration test from running before a development version has been created.
type: boolean
default: false
dev-orb-version:
description: >
The development version of the orb to test.
This value is automatically adjusted by the "trigger-integration-tests-workflow" job to correspond with the specific version created by the commit and should not be edited.
A "dev:alpha" version must exist for the initial pipeline run.
type: string
default: "dev:alpha"
filters: &filters
tags:
only: /.*/

workflows:
# Prior to producing a development orb (which requires credentials) basic validation, linting, and even unit testing can be performed.
# This workflow will run on every commit
test-pack:
unless: << pipeline.parameters.run-integration-tests >>
lint-pack:
jobs:
- orb-tools/lint # Lint Yaml files
- orb-tools/pack # Pack orb source
# Publish development version(s) of the orb.
- orb-tools/publish-dev:
- orb-tools/lint:
filters: *filters
- orb-tools/pack:
filters: *filters
- orb-tools/review:
filters: *filters
exclude: RC005,RC009
- orb-tools/publish:
orb-name: zenika-training/ztraining2strigo
context: orb-publishing # A restricted context containing your private publishing credentials. Will only execute if approved by an authorized user.
requires:
- orb-tools/lint
- orb-tools/pack
# Trigger an integration workflow to test the
# dev:${CIRCLE_SHA1:0:7} version of your orb
- orb-tools/trigger-integration-tests-workflow:
name: trigger-integration-dev
context: orb-publishing
vcs-type: << pipeline.project.type >>
requires:
- orb-tools/publish-dev
filters:
branches:
only:
- main

# This `integration-test_deploy` workflow will only run
# when the run-integration-tests pipeline parameter is set to true.
# It is meant to be triggered by the "trigger-integration-tests-workflow"
# job, and run tests on <your orb>@dev:${CIRCLE_SHA1:0:7}.
integration-test_deploy:
when: << pipeline.parameters.run-integration-tests >>
jobs:
# Publish a semver version of the orb. relies on
# the commit subject containing the text "[semver:patch|minor|major|skip]"
# as that will determine whether a patch, minor or major
# version will be published or if publishing should
# be skipped.
# e.g. [semver:patch] will cause a patch version to be published.
- orb-tools/dev-promote-prod-from-commit-subject:
orb-name: zenika-training/ztraining2strigo
[orb-tools/lint, orb-tools/review, orb-tools/pack]
# Use a context to hold your publishing token.
context: orb-publishing
add-pr-comment: false
fail-if-semver-not-indicated: true
publish-version-tag: false
filters:
branches:
only:
- main
filters: *filters
# 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]
filters: *filters
27 changes: 27 additions & 0 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2.1
orbs:
ztraining2strigo: zenika-training/ztraining2strigo@dev:<<pipeline.git.revision>>
orb-tools: circleci/[email protected]

filters: &filters
tags:
only: /.*/

workflows:
test-deploy:
jobs:
# Make sure to include "filters: *filters" in every test job you want to run as part of your deployment.
- orb-tools/pack:
filters: *filters
- orb-tools/publish:
orb-name: zenika-training/ztraining2strigo
vcs-type: << pipeline.project.type >>
pub-type: production
requires:
- orb-tools/pack
context: orb-publishing
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
33 changes: 0 additions & 33 deletions .github/ISSUE_TEMPLATE/BUG.md

This file was deleted.

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/Zenika-Training/ztraining2strigo-orb/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 `zenika-training/ztraining2strigo` 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?
13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md

This file was deleted.

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/Zenika-Training/ztraining2strigo-orb/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?
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

42 changes: 18 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE/PULL_REQUEST.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
## PR Type

**SEMVER Update Type:**
- [ ] Major
- [ ] Minor
- [ ] Patch
What kind of change does this PR introduce?

## Description:
<!-- 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:

<!---
Describe your changes in detail, preferably in an imperative mood,
i.e., "add `commandA` to `jobB`"
-->
## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

## Motivation:
Issue Number: N/A

<!---
Share any open issues this PR references or otherwise describe the motivation to submit this pull request.
-->
## What is the new behavior?

**Closes Issues:**
- ISSUE URL
## Does this PR introduce a breaking change?
- [ ] Yes
- [ ] No

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

<!--
Thank you for contributing to CircleCI Orbs!
before submitting your a request, please go through the following
items and place an x in the [ ] if they have been completed
-->

- [ ] All new jobs, commands, executors, parameters have descriptions.
- [ ] Usage Example version numbers have been updated.
## Other information
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Orb Project Template
# Ztraining2strigo Orb

[![CircleCI Build Status](https://circleci.com/gh/Zenika-Training/ztraining2strigo-orb.svg?style=shield "CircleCI Build Status")](https://circleci.com/gh/Zenika-Training/ztraining2strigo-orb) [![CircleCI Orb Version](https://badges.circleci.com/orbs/zenika-training/ztraining2strigo.svg)](https://circleci.com/orbs/registry/orb/zenika-training/ztraining2strigo) [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/Zenika-Training/ztraining2strigo-orb/master/LICENSE)

Expand All @@ -8,24 +8,23 @@ Update Strigo class from Zenika training.

[CircleCI Orb Registry Page](https://circleci.com/orbs/registry/orb/zenika-training/ztraining2strigo) - 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/Zenika-Training/ztraining2strigo-orb/issues) to and [pull requests](https://github.com/Zenika-Training/ztraining2strigo-orb/pulls) against this repository!

### How to Publish

* Create and push a branch with your new features.
* When ready to publish a new production version, create a Pull Request from _feature branch_ to `master`.
* The title of the pull request must contain a special semver tag: `[semver:<segment>]` where `<segment>` is replaced by one of the following values.

| Increment | Description|
| ----------| -----------|
| major | Issue a 1.0.0 incremented release|
| minor | Issue a x.1.0 incremented release|
| patch | Issue a x.x.1 incremented release|
| skip | Do not issue a release|

Example: `[semver:major]`

* Squash and merge. Ensure the semver tag is preserved and entered as a part of the commit message.
* On merge, after manual approval, the orb will automatically be published to the Orb Registry.
### How to Publish An Update

1. Merge pull requests with desired changes to the main branch.
2. Find the current version of the orb.
- You can run `circleci orb info zenika-training/ztraining2strigo | grep "Latest"` to see the current version.
3. Create a [new Release](https://github.com/Zenika-Training/ztraining2strigo-orb/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.
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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.
The default `.circleci/config.yml` file contains the configuration code needed to automatically pack, test, and deploy any changes made to the contents of the orb source in this directory.

## @orb.yml

Expand Down
Loading

0 comments on commit 99b9281

Please sign in to comment.