flyio
Currently only deploys.Assumes there is a valid fly.toml in the path provided to --dir.
Installation
dagger install github.com/gerhard/daggerverse/flyio@v0.2.0
Entrypoint
Return Type
Flyio !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
token | Secret ! | - | fly auth token: `--token=env:FLY_API_TOKEN` |
org | String | "personal" | Fly.io org where all operations will run in, defaults to: `--org=personal` |
version | String | - | flyctl version to use: `--version=0.2.29` |
container | Container | - | Custom container to use as the base container |
Example
dagger -m github.com/gerhard/daggerverse/flyio@156130dfdc4809c39e747bece38537ddec9920b1 call \
--token env:MYSECRET
func (m *myModule) example(token *Secret) *Flyio {
return dag.
Flyio(token)
}
@function
def example(token: dagger.Secret, ) -> dag.Flyio:
return (
dag.flyio(token)
)
@func()
example(token: Secret, ): Flyio {
return dag
.flyio(token)
}
Types
Flyio 🔗
deploy() 🔗
Deploys app from current directory: dagger call ... deploy --dir=hello-static
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
dir | Directory ! | - | App directory - must contain `fly.toml` |
regions | [String ! ] | - | Regions - only deploy to the following regions |
image | String ! | - | Container image to use when deploying |
Example
dagger -m github.com/gerhard/daggerverse/flyio@156130dfdc4809c39e747bece38537ddec9920b1 call \
--token env:MYSECRET deploy --dir DIR_PATH --image string
func (m *myModule) example(ctx context.Context, token *Secret, dir *Directory, image string) string {
return dag.
Flyio(token).
Deploy(ctx, dir, image)
}
@function
async def example(token: dagger.Secret, dir: dagger.Directory, image: str) -> str:
return await (
dag.flyio(token)
.deploy(dir, image)
)
@func()
async example(token: Secret, dir: Directory, image: string): Promise<string> {
return dag
.flyio(token)
.deploy(dir, image)
}
create() 🔗
Creates app - required for deploy to work: dagger call ... create --app=gostatic-example-2024-07-03
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
app | String ! | - | App name: `--app=myapp-2024-07-03` |
Example
dagger -m github.com/gerhard/daggerverse/flyio@156130dfdc4809c39e747bece38537ddec9920b1 call \
--token env:MYSECRET create --app string
func (m *myModule) example(ctx context.Context, token *Secret, app string) string {
return dag.
Flyio(token).
Create(ctx, app)
}
@function
async def example(token: dagger.Secret, app: str) -> str:
return await (
dag.flyio(token)
.create(app)
)
@func()
async example(token: Secret, app: string): Promise<string> {
return dag
.flyio(token)
.create(app)
}
terminal() 🔗
Opens terminal in this app: dagger call ... terminal --app=gostatic-example-2024-07-03 --interactive
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
app | String ! | - | App name: `--app=myapp-2024-07-03` |
Example
dagger -m github.com/gerhard/daggerverse/flyio@156130dfdc4809c39e747bece38537ddec9920b1 call \
--token env:MYSECRET terminal --app string
func (m *myModule) example(token *Secret, app string) *Container {
return dag.
Flyio(token).
Terminal(app)
}
@function
def example(token: dagger.Secret, app: str) -> dagger.Container:
return (
dag.flyio(token)
.terminal(app)
)
@func()
example(token: Secret, app: string): Container {
return dag
.flyio(token)
.terminal(app)
}
destroy() 🔗
Destroys app: dagger call ... destroy --app=gostatic-example-2024-07-03
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
app | String ! | - | App name: `--app=myapp-2024-07-03` |
Example
dagger -m github.com/gerhard/daggerverse/flyio@156130dfdc4809c39e747bece38537ddec9920b1 call \
--token env:MYSECRET destroy --app string
func (m *myModule) example(ctx context.Context, token *Secret, app string) string {
return dag.
Flyio(token).
Destroy(ctx, app)
}
@function
async def example(token: dagger.Secret, app: str) -> str:
return await (
dag.flyio(token)
.destroy(app)
)
@func()
async example(token: Secret, app: string): Promise<string> {
return dag
.flyio(token)
.destroy(app)
}
run() 🔗
Run command against app, e.g. destroy, scale, etc.: dagger call ... run --cmd="machines list --app=myapp-2024-07-03"
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
cmd | [String ! ] ! | - | flyctl command |
Example
dagger -m github.com/gerhard/daggerverse/flyio@156130dfdc4809c39e747bece38537ddec9920b1 call \
--token env:MYSECRET run --cmd string1 --cmd string2
func (m *myModule) example(token *Secret, cmd []string) *Container {
return dag.
Flyio(token).
Run(cmd)
}
@function
def example(token: dagger.Secret, cmd: List[str]) -> dagger.Container:
return (
dag.flyio(token)
.run(cmd)
)
@func()
example(token: Secret, cmd: string[]): Container {
return dag
.flyio(token)
.run(cmd)
}