forked from codeforamerica/glossary-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from gohypergiant/develop
Merge develop into master
- Loading branch information
Showing
14 changed files
with
333 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fly.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Bug Report | ||
about: Create an issue regarding a bug | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Expected Behavior | ||
|
||
<!--- Tell us what should happen --> | ||
|
||
## Current Behavior | ||
|
||
<!--- Tell us what happens instead of the expected behavior --> | ||
|
||
## Possible Solution | ||
|
||
<!--- Not obligatory, but suggest a fix/reason for the bug, --> | ||
|
||
## Steps to Reproduce | ||
|
||
<!--- Provide a link to a live example, or an unambiguous set of steps to --> | ||
<!--- reproduce this bug. Include code to reproduce, if relevant --> | ||
1. | ||
2. | ||
3. | ||
4. | ||
|
||
## Context (Environment) | ||
|
||
<!--- How has this issue affected you? What are you trying to accomplish? --> | ||
<!--- Providing context helps us come up with a solution that is most useful in the real world --> | ||
|
||
<!--- Provide a general summary of the issue in the Title above --> | ||
|
||
## Detailed Description | ||
|
||
<!--- Provide a detailed description of the change or addition you are proposing --> | ||
|
||
## Possible Implementation | ||
|
||
<!--- Not obligatory, but suggest an idea for implementing addition or change --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
blank_issues_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: Feature Request | ||
about: Create an issue regarding a feature request | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Idea | ||
|
||
<!-- Please describe the desired behavior, pitch your idea, or suggest improvements --> | ||
|
||
## Is your feature related to a bug? | ||
|
||
<!-- Refer to a an existing bug, you can use #bugid --> | ||
|
||
## Alternatives | ||
|
||
<!-- Have you considered alternative solutions or implementations? Do you have an idea on how this should be implemented? --> | ||
|
||
## Additional Info | ||
|
||
<!-- Provide additional information or links to resources that can help with the creation of this feature. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
name: Other | ||
about: If nothing else matches | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
<!-- ONLY FOR USE IF NO OTHER SPECIFIC TEMPLATE MATCHES YOUR NEEDS --> | ||
|
||
# Summary | ||
|
||
<!-- Brief explanation of the issue. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
name: Request for Comment | ||
about: Create an issue regarding a rfc | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
# Summary | ||
|
||
<!-- Brief explanation of the feature. --> | ||
|
||
# Basic example | ||
|
||
<!-- If the proposal involves a new or changed API, include a basic code example.--> | ||
<!-- Omit this section if it's not applicable.--> | ||
|
||
# Motivation | ||
|
||
<!-- Why are we doing this? What use cases does it support? What is the expected outcome? --> | ||
|
||
<!-- | ||
Please focus on explaining the motivation so that if this RFC is not accepted, | ||
the motivation could be used to develop alternative solutions. In other words, | ||
enumerate the constraints you are trying to solve without coupling them too | ||
closely to the solution you have in mind. | ||
--> | ||
|
||
# Detailed design | ||
|
||
<!-- | ||
This is the bulk of the RFC. Explain the design in enough detail for somebody | ||
familiar with React to understand, and for somebody familiar with the | ||
implementation to implement. This should get into specifics and corner-cases, | ||
and include examples of how the feature is used. Any new terminology should be | ||
defined here. | ||
--> | ||
|
||
# Drawbacks | ||
|
||
<!-- | ||
Why should we *not* do this? Please consider: | ||
- implementation cost, both in term of code size and complexity | ||
- integration of this feature with other existing and planned features | ||
- cost of migrating existing integrations (is it a breaking change?) | ||
There are tradeoffs to choosing any path. Attempt to identify them here. | ||
--> | ||
|
||
# Alternatives | ||
|
||
<!-- What other designs have been considered? What is the impact of not doing this? --> | ||
|
||
# Adoption strategy | ||
|
||
<!-- | ||
If we implement this proposal, how will the team adopt it? Is | ||
this a breaking change? Can we write a codemod? Should we coordinate with | ||
other projects or libraries? | ||
--> | ||
|
||
# Unresolved questions | ||
|
||
<!-- Optional, but suggested for first drafts. What parts of the design are still TBD? --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## Description | ||
|
||
<!--- Describe your changes in detail --> | ||
|
||
## Related Issue | ||
|
||
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> | ||
<!--- Please link to the issue here: --> | ||
|
||
## Motivation and Context | ||
|
||
<!--- Why is this change required? What problem does it solve? --> | ||
|
||
## How Has This Been Tested? | ||
|
||
<!--- Please describe in detail how you tested your changes. --> | ||
|
||
## Screenshots (if appropriate): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- stable | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Branch to deploy' | ||
required: false | ||
|
||
jobs: | ||
set-fly-app-name: | ||
uses: ./.github/workflows/set-fly-app-name.yaml | ||
with: | ||
ref: ${{ inputs.branch || github.head_ref || github.ref }} # Use the input if it's there, otherwise use the head ref, otherwise use the ref | ||
|
||
dev: | ||
concurrency: hg-sandbox | ||
if: github.ref == 'refs/heads/develop' | ||
uses: ./.github/workflows/deploy-to-fly.yaml | ||
secrets: | ||
fly_access_token: ${{ secrets.FLY_API_TOKEN }} | ||
with: | ||
app_name: glossary-bot-develop | ||
environment: 'hg-sandbox' | ||
|
||
stable: | ||
concurrency: Hypergiant | ||
if: github.ref == 'refs/heads/stable' | ||
uses: ./.github/workflows/deploy-to-fly.yaml | ||
secrets: | ||
fly_access_token: ${{ secrets.FLY_API_TOKEN }} | ||
with: | ||
app_name: glossary-bot-stable | ||
environment: 'Hypergiant' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Deploy Glossary-Bot to Fly | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
app_name: | ||
description: 'App name' | ||
type: string | ||
required: true | ||
environment: | ||
description: 'Target environment. Defaults to hg-sandbox.' | ||
type: string | ||
required: false | ||
default: 'hg-sandbox' | ||
secrets: | ||
fly_access_token: | ||
description: 'Fly access token' | ||
required: true | ||
|
||
concurrency: | ||
group: ${{ inputs.app_name }} # Only one deploy at a time per app | ||
cancel-in-progress: true # Cancel any previous deploys and deploy the latest | ||
|
||
jobs: | ||
deploy-glossary-bot: | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment || 'hg-sandbox'}} | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.fly_access_token }} | ||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup flyctl | ||
id: setup-flyctl | ||
uses: superfly/flyctl-actions/setup-flyctl@master | ||
|
||
# flyctl launch with these arguments has the same effect as running flyctl deploy --remote-only --config fly.toml --name ${{ steps.set_app_name.outputs.app_name }} | ||
# therefore, we just run flyctl launch instead of flyctl deploy as a sort of upsert operation. | ||
- name: deploy glossary-box | ||
id: flyctl-launch | ||
run: | | ||
ENV_PARAMS=$(printf "%s" "$ENV_CONTENT" | sed 's/$/\\n/' | tr -d '\n') | ||
flyctl launch \ | ||
--auto-confirm \ | ||
--copy-config \ | ||
--ha=false \ | ||
--name ${{ inputs.app_name }} \ | ||
--now \ | ||
--org=${{ vars.FLY_ORG }} \ | ||
--region=${{ vars.FLY_REGION }} \ | ||
--remote-only \ | ||
--reuse-app \ | ||
$(printf "%s" "$ENV_PARAMS" | sed 's/^/-e /') \ | ||
-e FLY_APP_NAME=${{ inputs.app_name }} \ | ||
-e SLACK_TOKEN=${{ secrets.GLOSS_BOT_SLACK_TOKEN }} \ | ||
-e SLACK_WEBHOOK_URL=${{ secrets.SLACK_WEBHOOK_URL }} \ | ||
update-pr: | ||
runs-on: ubuntu-latest | ||
needs: [ deploy-glossary-bot ] | ||
steps: | ||
- name: Notify PR of successful update | ||
uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: | | ||
:rocket: Deployed to Fly! | ||
:link: https://${{ inputs.app_name }}.fly.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Set Fly.io App Name | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
type: string | ||
description: "The ref to format" | ||
required: true | ||
prefix: | ||
type: string | ||
description: "The prefix to add to the name" | ||
required: false | ||
default: "glossary-bot-" | ||
outputs: | ||
name: | ||
description: "The rendered name of the app" | ||
value: ${{ jobs.set_name.outputs.name }} | ||
|
||
jobs: | ||
set_name: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
name: ${{ steps.set_name.outputs.name }} | ||
|
||
steps: | ||
- id: set_name | ||
run: | | ||
echo "name=$(echo "${{ inputs.prefix }}${{ inputs.ref }}" | tr '/\' '-' | tr -C '[:lower:][:digit:]' '-' | tr '/\' '-' | sed 's/-*$//g')" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# fly.toml app configuration file generated for glossary-bot on 2023-09-08T04:01:01Z | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = "glossary-bot" | ||
primary_region = "iad" | ||
|
||
[build] | ||
builder = "paketobuildpacks/builder:full" | ||
|
||
[env] | ||
PORT = "8080" | ||
|
||
[http_service] | ||
internal_port = 8080 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
processes = ["app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Flask==1.0.2 | ||
Flask==2.2.5 | ||
Flask-Migrate==2.2.1 | ||
Flask-SQLAlchemy==2.3.2 | ||
Flask-Script==2.0.6 | ||
Flask-SQLAlchemy==3.0.3 | ||
Flask-Script==2.0.5 | ||
gunicorn==19.7.1 | ||
psycopg2==2.7.5 | ||
psycopg2==2.8.1 | ||
requests>=2.20.0 | ||
responses==0.5.1 | ||
responses==0.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
python-3.6.6 | ||
python-3.8.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sonar.projectKey=glossarybot | ||
sonar.exclusions=tests/** |