behrouz.babaki
behrouz.babaki
RRailway
Created by behrouz.babaki on 8/8/2023 in #✋|help
`railway up` always deploys to `production` environment
I confirm that using different RAILWAY_TOKEN variables in different deployment jobs resolved the issue. I'm marking this question as solved.
20 replies
RRailway
Created by behrouz.babaki on 8/8/2023 in #✋|help
`railway up` always deploys to `production` environment
Sure! Thanks a lot for the blog post!
20 replies
RRailway
Created by behrouz.babaki on 8/8/2023 in #✋|help
`railway up` always deploys to `production` environment
I can create different CI jobs (deploy-stage, deploy-production, etc.) for different environments and use the environment-specific RAILWAY_TOKEN for each job. I will try this approach and will report the result here.
20 replies
RRailway
Created by behrouz.babaki on 8/8/2023 in #✋|help
`railway up` always deploys to `production` environment
Yes, I'm deploying from gitlab. This is the deployment job in my .gitlab-ci.yml script:
.deploy-railway:
stage: deploy
image: node:slim
variables:
RAILWAY_TOKEN: $RAILWAY_TOKEN
cache:
key: node-cache
paths:
- node_modules/
script:
- npm i @railway/cli
- ./node_modules/@railway/cli/bin/railway up --environment $CI_ENVIRONMENT_NAME
.deploy-railway:
stage: deploy
image: node:slim
variables:
RAILWAY_TOKEN: $RAILWAY_TOKEN
cache:
key: node-cache
paths:
- node_modules/
script:
- npm i @railway/cli
- ./node_modules/@railway/cli/bin/railway up --environment $CI_ENVIRONMENT_NAME
20 replies
RRailway
Created by behrouz.babaki on 8/8/2023 in #✋|help
`railway up` always deploys to `production` environment
Thanks! I just realized that tokens are environment-specific. Does it mean that I cannot deploy to multiple environments using a single RAILWAY_TOKEN?
20 replies
RRailway
Created by behrouz.babaki on 8/8/2023 in #✋|help
`railway up` always deploys to `production` environment
Yes. The RAILWAY_TOKEN is a project token. I get the same result with a global install. Regardless of that, I think I still have to install it locally if I want to use railway up in a GitLab CI script, unless there is a preferred alternative.
20 replies
RRailway
Created by behrouz.babaki on 8/8/2023 in #✋|help
`railway up` always deploys to `production` environment
I use version 3.4.0
20 replies