Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

[expo-cli] EAS Build support experimental.npmToken in credentials.json #2603

Merged
merged 2 commits into from
Sep 9, 2020

Conversation

wkozyra95
Copy link
Contributor

@wkozyra95 wkozyra95 commented Sep 8, 2020

[do not merge before turtle changes are deployed]

Why

Support for private packages

How

add experimental.npmToken field to credentials.json

@brentvatne
Copy link
Member

brentvatne commented Sep 8, 2020

something doesn't feel quite right about having credentials.json also contain arbitrary env vars. for comparison, both netlify and vercel provide two options for setting env vars:

  1. set in config files (vercel.json / netlify.toml) - this is useful for env vars that are not secrets
  2. set on backend via cli or web ui, eg: vercel env add [secret-name] [secret-value] - this is useful for values you don't want in source control

i think we should do something similar. we probably want to have env vars in eas.json associated with build profiles, and then run eas build:secrets:add [name] [value] to encrypt/save the value on our backend and then load that in the build server when running a related build job


one concrete workflow concern i have about using credentials.json in this way is that you can no longer just clone the project and run a build without having committed credentials.json to source control.

Copy link
Member

@brentvatne brentvatne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's chat about this more before landing it

@brentvatne
Copy link
Member

i was just discussing this with @ide and another thing we could do here so that we aren't committing to this particular api is to constrain it specifically to just setting the NPM_TOKEN environment variable and flag it as experimental. i think in the longer term we want some solution for env vars like this but we may not have time to build this at the moment. so instead, we could add something like this to credentials.json:

"experimental": {

  "npmToken": "..."

}

@wkozyra95 wkozyra95 force-pushed the @wkozyra95/eas-build-secret-env branch 3 times, most recently from 0f66d06 to 1fa9222 Compare September 9, 2020 10:02
@wkozyra95 wkozyra95 changed the title [expo-cli] EAS Build support secretEnvs in credentials.json [expo-cli] EAS Build support experimental.npmToken in credentials.json Sep 9, 2020
@wkozyra95 wkozyra95 force-pushed the @wkozyra95/eas-build-secret-env branch from ecbde7f to 6c9e181 Compare September 9, 2020 10:31
@wkozyra95 wkozyra95 merged commit 33af37e into master Sep 9, 2020
@wkozyra95 wkozyra95 deleted the @wkozyra95/eas-build-secret-env branch September 9, 2020 10:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants