Skip to content

Commit

Permalink
Standardize Repository (#32)
Browse files Browse the repository at this point in the history
* Standardize Repository

* Add key files like code of conduct, contributing, etc
* Update to Go 1.17
* Use go:embed
* Switch from make to mage
* Update to latest v1 porter release
* Add assign to project workflow

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>

* Bump porter to alpha.13

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
  • Loading branch information
carolynvs committed Mar 11, 2022
1 parent f229be8 commit 5fd7916
Show file tree
Hide file tree
Showing 14 changed files with 1,662 additions and 246 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/assign-to-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# https://github.com/marketplace/actions/assign-to-one-project

name: Assign to Project

on:
issues:
types: [opened, labeled]
pull_request_target:
types: [opened, labeled]
env:
MY_GITHUB_TOKEN: ${{ secrets.ASSIGN_PROJECT_TOKEN }}

jobs:
assign_one_project:
runs-on: ubuntu-latest
name: Assign Issue to Project
steps:
- name: Assign Issue to Project
uses: srggrs/assign-one-project-github-action@1.3.1
if: ${{ github.event_name == 'issues' }}
with:
project: 'https://github.com/orgs/getporter/projects/1'
column_name: 'Inbox'
- name: Assign Pull Request to Project
uses: srggrs/assign-one-project-github-action@1.3.1
if: ${{ github.event_name == 'pull_request_target' }}
with:
project: 'https://github.com/orgs/getporter/projects/1'
column_name: 'In Progress'
75 changes: 75 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to project admins via email to Carolyn Van Slyck (`me@carolynvanslyck.com`)
or via direct message in [Slack] to Carolyn Van Slyck (`@carolynvs`).
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
[slack]: https://porter.sh/community/#slack
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributing Guide

This is part of the [Porter][porter] project. If you are a new contributor,
check out our [New Contributor Guide][new-contrib]. The Porter [Contributing
Guide][contrib] also has lots of information about how to interact with the
project.

[porter]: https://github.com/getporter/porter
[new-contrib]: https://porter.sh/contribute
[contrib]: https://porter.sh/src/CONTRIBUTING.md

---

* [Initial setup](#initial-setup)
* [Magefile explained](#magefile-explained)

---

# Initial setup

You need to have [porter installed](https://porter.sh/install) first. Then run
`mage build install`. This will build and install the mixin into your porter
home directory.

## Magefile explained

Here are the most common [Magefile](https://magefile.org) tasks:

* `build` builds both the runtime and client.
* `install` installs the mixin into **~/.porter/mixins**.
* `testUnit` runs the unit tests.
94 changes: 0 additions & 94 deletions Makefile

This file was deleted.

17 changes: 17 additions & 0 deletions REVIEWING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Reviewing Guide

This is part of the [Porter][porter] project and follows the Porter [Reviewing
Guide][review].

[porter]: https://github.com/getporter/porter
[review]: https://porter.sh/src/REVIEWING.md

## Cut a release

🧀💨

All mixins follow the same process for [cutting a release][release]. There is an additional step after tagging the release. When any documentation on the readme is changed, update the matching documentation page for the mixin on the porter website:

https://porter.sh/src/docs/content/mixins

[release]: https://porter.sh/src/REVIEWING.md#cut-a-release
43 changes: 16 additions & 27 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@
# Go
# Build your Go project.
# Add steps that test, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/go

trigger:
branches:
include:
include: # Only run builds for the main branch, and tagged releases such as v0.1.0
- refs/heads/main
- refs/tags/v*

pool:
vmImage: 'ubuntu-latest'

steps:
- task: GoTool@0
inputs:
version: '1.13.10'
displayName: 'Install Go'
- task: GoTool@0
inputs:
version: '1.17.8'
displayName: 'Install Go'

- script: |
set -xeuo pipefail
mkdir -p /home/vsts/go/bin/
echo "##vso[task.prependpath]/home/vsts/go/bin/"
displayName: 'Configure Go'
- script: go run mage.go ConfigureAgent
displayName: "Configure Agent"

- script: |
make build test-unit
displayName: 'Unit Test'
- script: mage Test
displayName: 'Test'

- script: |
make xbuild-all
displayName: 'Cross Compile'
- script: mage XBuildAll
displayName: 'Cross Compile'

- script: |
make publish
displayName: 'Publish'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
- script: mage Publish
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
displayName: 'Publish'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
4 changes: 2 additions & 2 deletions cmd/aws/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ func buildSchemaCommand(m *aws.Mixin) *cobra.Command {
cmd := &cobra.Command{
Use: "schema",
Short: "Print the json schema for the mixin",
RunE: func(cmd *cobra.Command, args []string) error {
return m.PrintSchema()
Run: func(cmd *cobra.Command, args []string) {
m.PrintSchema()
},
}
return cmd
Expand Down
Loading

0 comments on commit 5fd7916

Please sign in to comment.