Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to run all railway commands with RAILWAY_TOKEN #105

Closed
kevinwolfcr opened this issue May 3, 2021 · 14 comments · Fixed by #126
Closed

Ability to run all railway commands with RAILWAY_TOKEN #105

kevinwolfcr opened this issue May 3, 2021 · 14 comments · Fixed by #126

Comments

@kevinwolfcr
Copy link

First of all, I want to thank all the contributors who made Railway possible, I am exploring using it for my next project (a Remix app with a Postgres database consumed by Prisma) because I have searched for existing services that allows me to automatically create per-environment databases and so far Railway has been the only one that allowed me to to this -- great work!

The Problem

I want to create a GitHub Action for my project that first validates the project (build, lint, test) and then, only if those tests passes, deploy to Railway. This is because, currently, only the railway run command is reading the RAILWAY_TOKEN environment variable.

Proposed solution

If all commands could read the RAILWAY_TOKEN environment variable, it would unleash its power by making it completely usable in headless environments like CI/CD systems.

@berviantoleo
Copy link

I looking forward in this too. I really need for railway up. Maybe I can help about this?

@JakeCooper
Copy link
Contributor

Oh we didn't see this until now! I've added push events into our Discord for all future issues sorry about that!

Ya this would be great. We can have a look into it and circle back pretty soon! Will comment back when resolved

@ajhalili2006
Copy link

Hey, @elkevinwolf! The CLI now supports RAILWAY_TOKEN for all commands, as of Railway Changelog #30.

Also @JakeCooper, can you close and lock this issue as resolved? Thanks.

@JakeCooper
Copy link
Contributor

Thanks @AndreiJirohHaliliDev2006!

Yes indeed!

@berviantoleo
Copy link

berviantoleo commented May 26, 2021

Hey, @elkevinwolf! The CLI now supports RAILWAY_TOKEN for all commands, as of Railway Changelog #30.

Also @JakeCooper, can you close and lock this issue as resolved? Thanks.

Hi @AndreiJirohHaliliDev2006 / @JakeCooper , sorry I just want to make sure. Is it already published? I just curious, so for RAILWAY_TOKEN need to exactly one line with the command? or I can define from another line? Since I try at my github action, seems not work.

https://github.com/bervProject/tell-me-everything-api/runs/2671890622?check_suite_focus=true

image

@JakeCooper
Copy link
Contributor

Oops! Just pushed a new release. Should be live as of 0.2.22!

@berviantoleo
Copy link

Seems I am not understand how to use RAILWAY_TOKEN. I still meet same error (ask me to login) at 0.2.22. Maybe I need to login first with the RAILWAY_TOKEN?

https://github.com/bervProject/tell-me-everything-api/runs/2672088984?check_suite_focus=true

image

@ajhalili2006
Copy link

Seems I am not understand how to use RAILWAY_TOKEN. I still meet same error (ask me to login) at 0.2.22. Maybe I need to login first with the RAILWAY_TOKEN?

https://github.com/bervProject/tell-me-everything-api/runs/2672088984?check_suite_focus=true

image

@berviantoleo You may need to do this instead:

# if you want to use environments in GitHub Actions to control deployments
# please see the GitHub Docs for that.
- name: Deploy to Railway
  run: |
     RAILWAY_TOKEN=$RAILWAY_TOKEN railway up
  env:
     RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}

Also, it's currently not possible to sign in without email prompts (aka using an API token for logging in) to the CLI for now.

@gschier
Copy link
Contributor

gschier commented May 27, 2021

@berviantoleo it seems like it's being set to "" by this line?
image

@coffee-cup
Copy link
Contributor

We've discovered an issue with using railway up and the project token. Will fix that today and let you know!

@berviantoleo
Copy link

@berviantoleo it seems like it's being set to "" by this line?
image

Hi @gschier. No, it's not. It will be replaced when the value at the left side True. When the left side is false, the right side will not executed.

We've discovered an issue with using railway up and the project token. Will fix that today and let you know!

I think this one the problem that I met. So I will wait the #126 instead.

@coffee-cup
Copy link
Contributor

This should be fixed and live in release v0.2.25 https://github.com/railwayapp/cli/releases/tag/v0.2.25

You don't need to railway link or login at all. If you up with the RAILWAY_TOKEN the associated project and environment will be used.

Please let me know if you have any further issues with it

@berviantoleo
Copy link

This should be fixed and live in release v0.2.25 https://github.com/railwayapp/cli/releases/tag/v0.2.25

You don't need to railway link or login at all. If you up with the RAILWAY_TOKEN the associated project and environment will be used.

Please let me know if you have any further issues with it

Thanks. It's working as expected.

@rcamarano
Copy link

I'm having the same problem here. Token not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants