Skip to content

Commit

Permalink
github boilerplate, readme updates, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrock-thmdo committed Jul 24, 2024
1 parent 1b49d0a commit 15bd21d
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @thermondo/platform
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI

on:
push:
branches: [ main ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "**" ]

permissions:
contents: read
# packages: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint
run: make lint
9 changes: 9 additions & 0 deletions .github/workflows/create-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -Eeuo pipefail

gh release create "${RELEASE_TAG}" --draft --generate-notes

artifact="buildpack.tar.gz"
rm -f "${artifact}"
tar czf "${artifact}" bin
gh release upload "${RELEASE_TAG}" "${artifact}" --clobber
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
workflow_dispatch:
inputs:
tag:
description: "The tag you want to assign to the release"
required: true
default: "v0.0.0"

permissions:
contents: write

env:
RELEASE_TAG: "${{ inputs.tag }}"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
run: ./.github/workflows/create-release.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tar.gz
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lint:
@shellcheck bin/*
@echo "shellcheck: no lint found"
.PHONY: lint
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
# Signal Sciences Heroku Buildpack

The [current Signal Sciences buildpack](https://dl.signalsciences.net/sigsci-heroku-buildpack/sigsci-heroku-buildpack_latest.tgz)
is unmaintained, has no license, and does things we don't necessarily want (or need).
Run the Signal Sciences ([Fastly WAF](https://www.fastly.com/products/web-application-api-protection))
agent inside Heroku.

This is thermondo's implementation based on our [sigsci-container](https://github.com/thermondo/sigsci-container).
It is configured the same way the container is (same environment variables, etc.). See the README
there for details. To use, put something like this in your Procfile:
## Why?

The [official Signal Sciences buildpack](https://docs.fastly.com/en/ngwaf/heroku) is unmaintained,
has no license, and does things we don't necessarily want (or need). This is thermondo's
implementation based on our [sigsci-container project](https://github.com/thermondo/sigsci-container).

## Quick Start

Add the buildpack to your Heroku app:

```bash
heroku buildpacks:add https://github.com/thermondo/heroku-buildpack-sigsci/releases/download/v0.0.1/buildpack.tar.gz
```

🚨 _It's highly recommended that you use the **release tarball** URL instead of the GitHub repo URL._

Then in your app's [Profile](https://devcenter.heroku.com/articles/procfile) add something like this:

```plaintext
web: ./sigsci/bin/start <the command you want to execute>
```

The buildpack is configured the same way the container is (same environment variables, etc.). See
the [Configuration section of the container README](https://github.com/thermondo/sigsci-container?tab=readme-ov-file#configuration)
for details.

## Developing

### Creating Releases

Go to [the release workflow](https://github.com/thermondo/heroku-buildpack-sigsci/actions/workflows/release.yml)
and manually trigger a release. Specify an appropriate tag name using semantic versioning rules.

Then go to the newly created draft release on the [releases page](https://github.com/thermondo/heroku-buildpack-sigsci/releases),
polish it up, and publish it.

0 comments on commit 15bd21d

Please sign in to comment.