Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
feat: initial release commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bhayes-slalom committed Jul 8, 2022
0 parents commit 89154e3
Show file tree
Hide file tree
Showing 112 changed files with 8,686 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Code of Conduct

All participants of Slalom Build are expected to abide by our Code of Conduct, both online and during in-person events that are hosted and/or associated with Slalom Build.

## The Pledge

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

## The Standards

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

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Referring to people by their preferred pronouns and using gender-neutral pronouns when uncertain

Examples of unacceptable behaviour by participants include:

- Trolling, insulting/derogatory comments, public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Not being respectful to reasonable communication boundaries, such as 'leave me alone,' 'go away,' or 'I’m not discussing this with you.'
- The usage of sexualised language or imagery and unwelcome sexual attention or advances
- Swearing, usage of strong or disturbing language
- Starting and/or participating in arguments related to politics
- Assuming or promoting any kind of inequality including but not limited to: age, body size, disability, ethnicity, gender identity and expression, nationality and race, personal appearance, religion, or sexual identity and orientation
- Other conduct which you know could reasonably be considered inappropriate in a professional setting.

## Enforcement

Violations of the Code of Conduct may be reported by sending an email to ,<a href="mailto:[email protected]">[email protected]</a>. All reports will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Further details of specific enforcement policies may be posted separately.

We hold the right and responsibility to remove comments or other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any members for other behaviours that they deem inappropriate, threatening, offensive, or harmful.

## Attribution

This Code of Conduct is adapted from [dev.to](https://dev.to).
84 changes: 84 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Contributing

> Contributing to fusion is welcome and encouraged! Got a terraform template that follows Secure Build practices and would be good for Fusion?
> Contribute!
## Setup 🔧

Getting setup is pretty simple. Just make sure you've got Go installed and `$GOPATH/bin` is in your `PATH` and these next steps will
get you up and running.

```
# Install the dev tools
make tools
# Run the test suite
make test
# Install fusion and fusionctl to $GOPATH/bin
make install
```

## Adding a terraform resource to fusion 🧬

Terraform resources in fusion are very simple. A terraform resource is made up of a few things:

1. A [go text/template](https://pkg.go.dev/text/template)
2. A struct for the template's configurable values (see [templates](./templates/))
3. A struct for the command to create the template that implements the `Run(ctx *commands.Context) error` method

That's it! This repository is designed intentionally to be simple. We even provide you with a dev tool to generate 99% of the code so all you need to bring is your terraform file.

## Using Fusionctl ⚡

1. Generate an example resource

```bash
# Let's generate an implementation of an AWS EC2 instance generator for fusion.

# This command outputs the following directly to Stdout:
# - generated Go code
# - generated template file
# - generated cli command

fusionctl new resource ec2_instance \
--provider aws \
--fields="name=string;description=string;vpc_id=string;ingress_from_port=int" \
--verbose
```

2. Verify the output looks correct and has everything you want
3. Save the output

```bash
# Now that we've verified everything looks good, we're going to write the output directly
# into the project so you don't have to write any code!

# We do this with the `--save` flag.

# Navigate to your cloned instance of fusion
cd fusion/

# Generate the resource but with the --save flag
fusionctl new resource ec2_instance \
--provider aws \
--fields="name=string;description=string;vpc_id=string;ingress_from_port=int" \
--verbose
--save
```

4. Add your new command to it's associated provider struct (e.g. [aws commands](./internal/commands/awscmd/cmd_aws.go))
5. Try your command!

```bash
# Verify all the tests still pass
make test

# Install fusion again with your changes added
make install

# Try your new command
fusion new aws ec2_instance --name="example" --description="example" --vpc-id="1234" --ingress-from-port="8080"
```

6. Open a pull request with your new feature added! 🎉
22 changes: 22 additions & 0 deletions .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Development

View the available Makefile commands for building, testing, installing, and formatting the application with `make help`

### Requirements

Before running the test suite or building the application, install development tools with:

```
# Install the dev tools
make tools
```

```
make help
install : Install fusion and fusionctl cli
tools : Install development tools
clean : Clean generated files and test cache
test : Run unit tests
build : Build executables with goreleaser
```
17 changes: 17 additions & 0 deletions .github/workflows/closed-issue-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Closed Issue Message
on:
issues:
types: [closed]
jobs:
auto_comment:
runs-on: ubuntu-latest
steps:
- uses: aws-actions/closed-issue-message@v1
with:
# These inputs are both required
repo-token: "${{ secrets.GITHUB_TOKEN }}"
message: |
### ⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
45 changes: 45 additions & 0 deletions .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Close stale issues"

# Controls when the action will run.
on:
schedule:
- cron: "0 0 * * *"

jobs:
cleanup:
runs-on: ubuntu-latest
name: Stale issue job
steps:
- uses: aws-actions/stale-issue-cleanup@v4
with:
# Setting messages to an empty string will cause the automation to skip
# that category
ancient-issue-message: We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.
stale-issue-message: This issue has not received a response in 2 weeks. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
stale-pr-message: Greetings! It looks like this PR hasn't been active in longer than a week, add a comment or an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
# These labels are required
stale-issue-label: closing-soon
exempt-issue-labels: no-autoclose
stale-pr-label: no-pr-activity
exempt-pr-labels: awaiting-approval
response-requested-label: response-requested

# Don't set closed-for-staleness label to skip closing very old issues
# regardless of label
closed-for-staleness-label: closed-for-staleness

# Issue timing
days-before-stale: 14
days-before-close: 30
days-before-ancient: 365

# If you don't want to mark a issue as being ancient based on a
# threshold of "upvotes", you can set this here. An "upvote" is
# the total number of +1, heart, hooray, and rocket reactions
# on an issue.
minimum-upvotes-to-exempt: 10

repo-token: ${{ secrets.GITHUB_TOKEN }}
loglevel: DEBUG
# Set dry-run to true to not perform label or close actions.
dry-run: false
Loading

0 comments on commit 89154e3

Please sign in to comment.