Alan Schio
Posted on August 28, 2024
It is easy to find integrations for Github or GitLab, but i spent a couple of minutes trying to make it work, so why no sharing?
Create Fly Token
First go to your Fly.io App and create a Deploy Token (https://fly.io/apps/your-app/tokens
)
Let the Expiration
if you want it to never expires
Add a Repository Variable
Now go to your bitbucket repository settings, under Pipeline side menu, at Repository Variables (https://bitbucket.org/YOURORG/YOURPROJECT/YOURREPO/pipelines/repository-variables
).
And create a new variable with the name FLY_API_TOKEN
.
Create the pipeline file
Now create your bitbucket-pipelines.yml
file and use the golang
image so you can install the flyctl
and deploy your app.
image: golang:1.15
pipelines:
default:
- step:
name: Deploy to Fly.io
deployment: production
script:
- apt-get update -qq && apt-get install -y curl
- curl -L https://fly.io/install.sh | sh
- export FLYCTL_INSTALL="/root/.fly"
- export PATH="$FLYCTL_INSTALL/bin:$PATH"
- flyctl deploy
💖 💪 🙅 🚩
Alan Schio
Posted on August 28, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.