Skip to content

Commit

Permalink
fix type, enable auto deploy to fly
Browse files Browse the repository at this point in the history
  • Loading branch information
jpillora committed Aug 5, 2024
1 parent 6592085 commit 397db1c
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .github/Dockerfile.fly
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM ghcr.io/jpillora/installer
ENTRYPOINT ["/app/bin"]
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,15 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
name: Deploy to Fly
needs: release_docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}


56 changes: 27 additions & 29 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,38 @@
app = "installer"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
builder = "paketobuildpacks/builder:base"
buildpacks = ["gcr.io/paketo-buildpacks/go"]
dockerfile = ".github/Dockerfile.fly"

[env]
PORT = "8080"
PORT = "8080"

[experimental]
auto_rollback = true
auto_rollback = true

[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"

[[services.ports]]
force_https = true
handlers = ["http"]
port = 80

[[services.ports]]
handlers = ["tls", "http"]
port = 443

[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"

[[services.ports]]
force_https = true
handlers = ["http"]
port = 80

[[services.ports]]
handlers = ["tls", "http"]
port = 443

[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
2 changes: 1 addition & 1 deletion handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type Query struct {

type Result struct {
Query
ResolvedResolve string
ResolvedRelease string
Timestamp time.Time
Assets Assets
M1Asset bool
Expand Down
2 changes: 1 addition & 1 deletion handler/handler_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (h *Handler) execute(q Query) (Result, error) {
result := Result{
Timestamp: ts,
Query: q,
ResolvedResolve: release,
ResolvedRelease: release,
Assets: assets,
M1Asset: assets.HasM1(),
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function install {
PROG="{{ .Program }}"
ASPROG="{{ .AsProgram }}"
MOVE="{{ .MoveToPath }}"
RELEASE="{{ .Release }}" # {{ .ResolvedResolve }}
RELEASE="{{ .Release }}" # {{ .ResolvedRelease }}
INSECURE="{{ .Insecure }}"
OUT_DIR="{{ if .MoveToPath }}/usr/local/bin{{ else }}$(pwd){{ end }}"
GH="https://github.com"
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ repository: https://github.com/{{ .User }}/{{ .Program }}
user: {{ .User }}
program: {{ .Program }}{{if .AsProgram }}
as: {{ .AsProgram }}{{end}}
release: {{ .ResolvedResolve }}
release: {{ .ResolvedRelease }}
move-into-path: {{ .MoveToPath }}
sudo-move: {{ .SudoMove }}
used-search: {{ .Search }}
Expand Down

0 comments on commit 397db1c

Please sign in to comment.