Skip to content

Commit

Permalink
Merge pull request #7 from ThreeDotsLabs/readmes
Browse files Browse the repository at this point in the history
Add websites and READMEs
  • Loading branch information
m110 committed Aug 30, 2024
2 parents aa03a1c + 1235037 commit 23d7907
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 68 deletions.
55 changes: 34 additions & 21 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master

jobs:
apply:
plan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -19,25 +19,25 @@ jobs:
env:
CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}

- id: fmt
run: terraform fmt -check
continue-on-error: true
- run: terraform fmt -check

- id: init
run: terraform init
- run: terraform init
env:
GOOGLE_APPLICATION_CREDENTIALS: credentials.json

- id: validate
run: terraform validate -no-color | tee validation
- run: terraform validate -no-color

- id: plan
run: terraform plan -out=out.tfplan -no-color -input=false 2> plan_errors
- run: terraform plan -out=out.tfplan -no-color -input=false
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.TERRAFORM_GITHUB_TOKEN }}
GOOGLE_APPLICATION_CREDENTIALS: credentials.json

- uses: actions/upload-artifact@v4
with:
name: out.tfplan
path: out.tfplan

- run: |
TMP_OUTPUT=$(terraform show -no-color out.tfplan)
FORMATTED_OUTPUT="${TMP_OUTPUT:0:65536}"
Expand All @@ -46,22 +46,35 @@ jobs:
- id: output
run: |
{
echo 'PLAN_OUTPUT<<EOF'
echo "# Plan to be applied"
echo '```'
sed '1d' output
echo '```'
echo EOF
} >> "$GITHUB_OUTPUT"
} >> "$GITHUB_STEP_SUMMARY"
apply:
needs: plan
environment: production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.9.5
terraform_wrapper: false

- run: echo -n "$CREDENTIALS" > credentials.json
env:
CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}

- id: init
run: terraform init
env:
GOOGLE_APPLICATION_CREDENTIALS: credentials.json

- name: Approve
uses: trstringer/manual-approval@v1.9.1
timeout-minutes: 5
- uses: actions/download-artifact@v4
with:
issue-title: "Terraform changes require approval"
secret: ${{ github.TOKEN }}
approvers: m110,roblaszczak
issue-body: ${{ steps.output.outputs.PLAN_OUTPUT }}
minimum-approvals: 1
name: out.tfplan

- name: Apply
run: terraform apply out.tfplan
Expand Down
79 changes: 35 additions & 44 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,98 +17,89 @@ provider "github" {
module "pubsub_repo_amazonsqs" {
source = "./modules/pubsub_repo"

id = "amazonsqs"
name = "Amazon SQS/SNS"
description = ""
url = ""
id = "amazonsqs"
name = "Amazon SQS/SNS"

details = "It uses the [Amazon SQS](https://aws.amazon.com/sqs/) and [Amazon SNS](https://aws.amazon.com/sns/) services."
}

module "pubsub_repo_amqp" {
source = "./modules/pubsub_repo"

id = "amqp"
name = "AMQP"
description = ""
url = ""
id = "amqp"
name = "AMQP"
}

module "pubsub_repo_bolt" {
source = "./modules/pubsub_repo"

id = "bolt"
name = "Bolt"
description = ""
url = ""
id = "bolt"
name = "Bolt"

details = "It uses the [Bolt](https://github.com/etcd-io/bbolt) database."
}

module "pubsub_repo_firestore" {
source = "./modules/pubsub_repo"

id = "firestore"
name = "Firestore"
description = ""
url = ""
id = "firestore"
name = "Firestore"

details = "It uses the [Firestore](https://firebase.google.com/docs/firestore) database."
}

module "pubsub_repo_googlecloud" {
source = "./modules/pubsub_repo"

id = "googlecloud"
name = "Google Cloud Pub/Sub"
description = ""
url = ""
id = "googlecloud"
name = "Google Cloud Pub/Sub"

details = "It uses the [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) service."
}

module "pubsub_repo_http" {
source = "./modules/pubsub_repo"

id = "http"
name = "HTTP"
description = ""
url = ""
id = "http"
name = "HTTP"
}

module "pubsub_repo_io" {
source = "./modules/pubsub_repo"

id = "io"
name = "IO"
description = ""
url = ""
id = "io"
name = "IO"
}

module "pubsub_repo_kafka" {
source = "./modules/pubsub_repo"

id = "kafka"
name = "Kafka"
description = ""
url = ""
id = "kafka"
name = "Kafka"
}

module "pubsub_repo_nats" {
source = "./modules/pubsub_repo"

id = "nats"
name = "NATS"
description = ""
url = ""
id = "nats"
name = "NATS"

details = "It targets NATS - primarily streaming use cases via [JetStream](https://docs.nats.io/nats-concepts/jetstream)."

}

module "pubsub_repo_redisstream" {
source = "./modules/pubsub_repo"

id = "redisstream"
name = "Redis"
description = ""
url = ""
id = "redisstream"
name = "Redis"

default_branch = "main"
}

module "pubsub_repo_sql" {
source = "./modules/pubsub_repo"

id = "sql"
name = "SQL (Postgres/MySQL)"
description = ""
url = ""
id = "sql"
name = "SQL (Postgres/MySQL)"
}
39 changes: 39 additions & 0 deletions modules/pubsub_repo/README.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Watermill ${name} Pub/Sub
<img align="right" width="200" src="https://threedots.tech/watermill-io/watermill-logo.png">

[![CI Status](https://github.com/ThreeDotsLabs/watermill-${id}/actions/workflows/master.yml/badge.svg)](https://github.com/ThreeDotsLabs/watermill-${id}/actions/workflows/master.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/ThreeDotsLabs/watermill-${id})](https://goreportcard.com/report/github.com/ThreeDotsLabs/watermill-${id})

This is Pub/Sub for the [Watermill](https://watermill.io/) project.
${details}

See [DEVELOPMENT.md](./DEVELOPMENT.md) for more information about running and testing.

Watermill is a Go library for working efficiently with message streams. It is intended
for building event driven applications, enabling event sourcing, RPC over messages,
sagas and basically whatever else comes to your mind. You can use conventional pub/sub
implementations like Kafka or RabbitMQ, but also HTTP or MySQL binlog if that fits your use case.

All Pub/Sub implementations can be found at [https://watermill.io/pubsubs/](https://watermill.io/pubsubs/).

Documentation: https://watermill.io/

Getting started guide: https://watermill.io/docs/getting-started/

Issues: https://github.com/ThreeDotsLabs/watermill/issues

## Contributing

All contributions are very much welcome. If you'd like to help with Watermill development,
please see [open issues](https://github.com/ThreeDotsLabs/watermill/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+)
and submit your pull request via GitHub.

## Support

If you didn't find the answer to your question in [the documentation](https://watermill.io/), feel free to ask us directly!

Please join us on the `#watermill` channel on the [Three Dots Labs Discord](https://discord.gg/QV6VFg4YQE).

## License

[MIT License](./LICENSE)
20 changes: 19 additions & 1 deletion modules/pubsub_repo/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "github_repository" "repo" {
name = "watermill-${var.id}"
description = "${var.name} Pub/Sub for the Watermill project."

homepage_url = var.url
homepage_url = "https://watermill.io/pubsubs/${var.id}/"

has_downloads = true
has_issues = false
Expand All @@ -33,3 +33,21 @@ resource "github_repository" "repo" {

vulnerability_alerts = true
}

resource "github_branch_default" "master" {
repository = github_repository.repo.name
branch = var.default_branch
}

resource "github_repository_file" "readme" {
repository = github_repository.repo.name
branch = github_branch_default.master.branch
file = "README.md"
content = templatefile("${path.module}/README.template.md", {
id = var.id
name = var.name
details = var.details
})
commit_message = "Update README.md (by Terraform)"
overwrite_on_create = true
}
8 changes: 6 additions & 2 deletions modules/pubsub_repo/vars.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
variable "id" {}
variable "name" {}
variable "description" {}
variable "url" {}
variable "default_branch" {
default = "master"
}
variable "details" {
default = ""
}

0 comments on commit 23d7907

Please sign in to comment.