Skip to content

Commit

Permalink
Merge pull request #35 from CircleCI-Public/PIPE-3637-match-orb-template
Browse files Browse the repository at this point in the history
Match orb template
  • Loading branch information
Markl121 authored May 4, 2023
2 parents ce0abef + 06a922d commit c044e99
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 176 deletions.
107 changes: 28 additions & 79 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,41 @@
version: 2.1

setup: true
orbs:
# Replace this with your own!
continuation: circleci/continuation@<<pipeline.parameters.dev-orb-version>>
orb-tools: circleci/[email protected]
shellcheck: 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"
orb-tools: circleci/[email protected]
shellcheck: circleci/[email protected]

jobs:
# Define one or more jobs which will utilize your orb's commands and parameters to validate your changes.
integration-test-1:
docker:
- image: cimg/base:stable
steps:
- checkout
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
- orb-tools/lint:
filters: *filters
- orb-tools/pack:
filters: *filters
- orb-tools/review:
filters: *filters
- shellcheck/check:
dir: ./src/scripts
exclude: SC2148
# If you accept building open source forks, protect your secrects behind a restricted context.
# A job containing restricted context (which holds your orb publishing credentials) may only be accessed by a user with proper permissions.
# An open source user may begin a pipeline with a PR, and once the pipeline is approved by an authorized user at this point, the pipeline will continue with the proper context permissions.
- hold-for-dev-publish:
type: approval
shell: bash
filters: *filters
- orb-tools/publish:
orb-name: circleci/continuation
vcs-type: << pipeline.project.type >>
requires:
- orb-tools/lint
- orb-tools/review
- orb-tools/pack
- shellcheck/check
# Publish development version(s) of the orb.
- orb-tools/publish-dev:
orb-name: circleci/continuation
context: orb-publisher
requires: [hold-for-dev-publish]
# 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-publisher
requires:
- orb-tools/publish-dev

# 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:
# Run any integration tests defined within the `jobs` key.
- integration-test-1
# 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: circleci/continuation
# Use a context to hold your publishing token.
context: orb-publisher
add-pr-comment: false
fail-if-semver-not-indicated: true
publish-version-tag: false
requires:
- integration-test-1
filters:
branches:
only:
- master
- 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
44 changes: 44 additions & 0 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: 2.1
orbs:
continuation: circleci/continuation@dev:<<pipeline.git.revision>>
orb-tools: circleci/[email protected]

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

jobs:
# You may want to add additional validation steps to ensure the commands are working as expected.
command-tests:
docker:
- image: cimg/base:current
steps:
- checkout
# Run your orb's commands to validate them.
- continuation/continue:
configuration_path: ""
when: on_fail

workflows:
test-deploy:
jobs:
# Make sure to include "filters: *filters" in every test job you want to run as part of your deployment.
- command-tests:
filters: *filters
- orb-tools/pack:
filters: *filters
- orb-tools/publish:
orb-name: circleci/continuation
vcs-type: << pipeline.project.type >>
pub-type: production
requires:
- orb-tools/pack
- command-tests
context: orb-publisher
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/

# VS Code Extension Version: 1.4.0
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/CircleCI-Public/continuation-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 `circleci/continuation` 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?
14 changes: 0 additions & 14 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/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?
44 changes: 18 additions & 26 deletions .github/PULL_REQUEST_TEMPLATE/PULL_REQUEST.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
## PR Type
What kind of change does this PR introduce?

**SEMVER Update Type:**
- [ ] Major
- [ ] Minor
- [ ] Patch
<!-- 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:

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

<!---
Describe your changes in detail, preferably in an imperative mood,
i.e., "add `commandA` to `jobB`"
-->
Issue Number: N/A

## Motivation:
## What is the new behavior?

<!---
Share any open issues this PR references or otherwise describe the motivation to submit this pull request.
-->
## Does this PR introduce a breaking change?
- [ ] Yes
- [ ] No

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

## Checklist:

<!--
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.
- [ ] Changelog has been updated.
## Other information
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# orb.yml is "packed" from source, and not published directly from the repository.
orb.yml
orb.yml
.DS_Store
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 <organization>
Copyright (c) 2021 Circle Internet Services, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit c044e99

Please sign in to comment.