Gitlab CI/CD with fly.io

Hi,

I want to deploy to fly when we push on main branch.

I did follow this guide. (Continuous Deployment with GitLab · Fly)

But I do get this error.


`$ curl -L https://fly.io/install.sh | sh` `  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current` `                                 Dload  Upload   Total   Spent    Left  Speed` `100  1475    0  1475    0     0  13657      0 --:--:-- --:--:-- --:--:-- 13657` `######################################################################## 100.0%` `set channel to shell` `flyctl was installed successfully to /root/.fly/bin/flyctl` `Manually add the directory to your $HOME/.bash_profile (or similar)` `  export FLYCTL_INSTALL="/root/.fly"` `  export PATH="$FLYCTL_INSTALL/bin:$PATH"` `Run '/root/.fly/bin/flyctl --help' to get started` `$ flyctl deploy` `/bin/bash: line 130: flyctl: command not found`

I have the same gitlab.yaml and I do have the variables set as well.

Anyone knows why it does not deploy ?

Thanks

The error is : ```
/bin/bash: line 130: flyctl: command not found

It looks like you need to set a few environment variables. Based on GitLab CI/CD variables | GitLab, it looks like adding the following to the top of your .gitlab-ci.yml file:

variables:
  FLYCTL_INSTALL: "/root/.fly"
  PATH: "$FLYCTL_INSTALL/bin:$PATH"

If that doesn’t work, try:

deploy:
  script:
    - /root/.fly/bin/flyctl deploy

Hi @rubys,

The first option did not work.

The second option did work !

Thank you very much !