Cannot change default provider for environment thats created during GitHub Pull Request
I posted about this a while back (https://discord.com/channels/713503345364697088/1126899693549531136) but I cannot seem to get it to work. The default provider thats used when a PR is created is Deno, and I'd like it to be node. Ive added a
nixpacks.toml
file to the directory of the service thats being deployed but it doesnt seem to take effect. Any help is appreciated.59 Replies
Project ID:
d36cedc3-d1a4-453b-9e36-45d7299cabfd
d36cedc3-d1a4-453b-9e36-45d7299cabfd
please show us the nixpacks.toml file
the entire monorepo is deployed, and turbopack is used to run the command for this particular app
yarn start --filter=relay
- the nixpacks file is within the relay directory, not at the root of the application (we have other services that we dont want to use node as a provider for)single providers array with node, that side of things looks good to me
do you have a
NIXPACKS_CONFIG_FILE
variable set in the service?Dont appear to. To be clear the production and staging environments use a node provider no problem. Its the auto-generated environments via a pull request that dont use it.
Only Nixpacks variable set in production/staging is
NIXPACKS_NO_CACHE
if you don't have the nixpacks.toml file in the same directory as what set in the service settings railway won't be able to find it, so you'll need to set that variable
the toml file is in the same directory as the service. What do I set the variable value to? Assuming I add the variable to production and to staging and it will work for the PR environments? Will this effect the prod/staging setups that are already working?
okay so first, what is the root directory set to in the service settings?
and should the prod/staging environments be using node too?
root directory is not set -- the entire monorepo is deployed to this service and the command is just filtered to the particular package
for this particular service, yes
though so, just had to check though
okay and what folder is this nixpacks.toml file in
and side question, do you know what is causing nixpacks to detect deno?
root/packages/relay/nixpacks.toml
I dontthis that is the value you should set your
NIXPACKS_CONFIG_FILE
variable to
well of course minus the root, since I don't actually think you have a folder named root?I do not. Can I set this under the
Railway Config File Path
option for the service? If the env var is set does it need to be set for staging and prod? Not sure what settings the PR environments use
Appreciate the help btw!yeah that would achieve the same thing, and that would probably also carry it across the environments too
tbh I've done extremely little with multi environments on railway, so my knowledge on the behaviour around this is lacking
Hmm just tried using that option and it didnt seem to pick it up
Railway config path is set to
/packages/relay/nixpacks.toml
and you're absolutely positively sure that's the correct path
Yeah
also, would you be interested in showing me a screenshot of the files in the root of the project? maybe I'd see a reason for why railway thinks your using deno
Yeah Im good with that
because if railway stopped thinking you where using deno, that would solve your problems too right?
you don't use deno for anything in this project, right?
It would - and there is a service that uses Deno within the packages directory
then that is why, from the nixpacks docs
Deno is detected if there is a deno.{json,jsonc} file found or if any .{ts,tsx,js,jsx} file is found that imports something from deno.land.so you really can't change the fact that something is importing something from deno land
is it normal to have the rely app inside of the backend folder?
its not - they are both within /packages
ah my bad
yeah I see that now lol
does that nixpacks.toml file show up in your repo?
Yeah its in there
okay we'll try setting the
NIXPACKS_CONFIG_FILE
variable for the serviceOk I just moved the nixpacks file to the root of the entire monorepo, and changed the value of
Railway Config File Path
to nixpacks.toml
and it works
Maybe the leading slash when it was within the packages/relay was throwing it off? Going to try thatno, you definitely would need the leading forward slash, it's an absolute path after all
can I ask why you seem opposed to setting the
NIXPACKS_CONFIG_FILE
variable?Im not - ill give that a try now
so set it in production and staging and set its value to
/packages/relay/nixpacks.toml
?yes, but move the file back into the relay folder
since backend is deno right?
and I just set this for the relay service im guessing, not in project shared
we host our search service in relay as well so figured it shouldnt be a global thing
gotcha
Thats still using deno 🤔
you've set the
NIXPACKS_CONFIG_FILE
variable?show me the build table at the top of the build logs please?
thats more promising - before it just couldnt build the app using deno vs node
I wouldn't call that deno lol
make sure it's in the correct location in the branch you are deploying to railway?
Yeah its definitely in the repo
and you are absolutely sure your root directory is left as / in the service settings?
it doesnt have any value set
I removed the leading slash, and the build doesnt error out not finding the file, but the provider is still deno
hmm maybe its using node cause the build even though the provider in the settings still says node, cause the build is underway
what does the build table at the top of the build logs say?
Nixpacks file based configuration is experimental and may change
yeah it says node
so thats with no root directory set (hasnt changed), and the
NIXPACKS_CONFIG_FILE
variable set to packages/relay/nixpacks.toml
with no leading slashso all good?
and the provider in the settings still says Deno even though it actually used node
haha dont worry about that
beta
yeah its working - this will effect prod and staging too since that variable was set there in the first place so as long as those continue to use node as they were i think were all good!
awsome
Appreciate the help!
no problem!