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

Environment variables to build the app from AppCenter #1311

Closed
jdnichollsc opened this issue Jun 7, 2018 · 16 comments
Closed

Environment variables to build the app from AppCenter #1311

jdnichollsc opened this issue Jun 7, 2018 · 16 comments
Labels

Comments

@jdnichollsc
Copy link

jdnichollsc commented Jun 7, 2018

Hello guys,
Exist any option to build the app from AppCenter with the correct deployment key depending of the current branch? for example build the app for Staging if the branch is develop or build the app for Production if the branch is master

Thanks in advance and sorry for the question, I can't see any easy way using environment variables or something like that from the build configuration of AppCenter to do that
Best regards, Nicholls

@NickToropov NickToropov self-assigned this Jun 7, 2018
@NickToropov
Copy link
Contributor

NickToropov commented Jun 7, 2018

Hi @jdnichollsc, I think you can achieve it by specifying custom Environment variable with correct deployment key for every branch and then use appcenter-pre-build.sh to write it inside Android or iOS application.

Please, let me know if is was helpful for you situation.

@jdnichollsc
Copy link
Author

jdnichollsc commented Jun 7, 2018

@NickToropov thanks for the response! I already made the following configuration https://github.com/Microsoft/react-native-code-push#multi-deployment-testing
But do you have any example to change the deployment name using appcenter-pre-build.sh? I want to use a new deployment called Develop instead of Staging for the development build.

Thanks in advance!

@jdnichollsc
Copy link
Author

@NickToropov How can I change the build configuration to use Debug for my develop branch?
Example:

ios-setBuildConfiguration { buildConfiguration: 'Debug' }

Thanks in advance, Nicholls

@NickToropov
Copy link
Contributor

NickToropov commented Jun 8, 2018

Hi @jdnichollsc

How can I change the build configuration to use Debug for my develop branch?

If I understood you correctly you just need to create a new shared build scheme Debug:
screen shot 2018-06-08 at 12 35 42 pm
and push changes to your develop branch

Then go to appcenter.ms, select your application -> Build -> develop branch -> Configure Build and choose Debug scheme in Shared Scheme section:
screen shot 2018-06-08 at 12 44 12 pm

Now you'll be able to build your develop branch using Debug configuration.

Please, try this solution and let me know if it was helpful. Also please specify more details/clarifications if I misunderstood you.

@NickToropov
Copy link
Contributor

NickToropov commented Jun 8, 2018

But do you have any example to change the deployment name using appcenter-pre-build.sh? I want to use a new deployment called Develop instead of Staging for the development build.

please, clarify if Develop deployment belongs to CodePush? If so then you need just to create such deployment with appcenter cli:
appcenter codepush deployment add -a <ownerName>/<appName> Develop
and pass it to release-react command:
appcenter codepush release-react -a <ownerName>/<appName> -d Develop
Note, that before releasing with codepush cli you should update deployment key in your application and release new version with updated keys.

appcenter-pre-build.sh is executed only during appcenter build process.

@jdnichollsc
Copy link
Author

Ohh thanks @NickToropov, the example of the scheme is very important, we need that step from the documentation of Multi-Deployment Testing 👍

@NickToropov
Copy link
Contributor

@jdnichollsc glad to hear that I could help you! :)

@MikePodgorniy
Copy link

MikePodgorniy commented Jul 13, 2018

Hello there!

I want to change "Shared Scheme" in my app in appcenter.ms
But appcenter show me schemes MCourses & MCourses-tvOS
and I don't have any scheme from my workspace or project in the list on appcenter "Build configuration"

How to update this f#$X@ list?
I tried to create new brunch, build project but list still including only 2 items: MCourses & MCourses-tvOS

@jdnichollsc could you know how it works?

screen shot 2018-07-13 at 16 10 56

@jdnichollsc
Copy link
Author

@MikePodgorniy you need to create the schema from Xcode, publish the changes to the branch and later update the configuration of that branch from appcenter to use that schema :)

@MikePodgorniy
Copy link

@jdnichollsc you are right, it's easy :D
problem was in my "gitlab to bitbucket" solution
thanks

@jdnichollsc
Copy link
Author

@NickToropov sorry, what's the configuration for Staging? I can see the following issue from AppCenter:
2018-08-24T00:19:09.6933720Z ld: library not found for -lPods-MyApp

@filiphosko
Copy link

@jdnichollsc You can try looking at this #426

@jdnichollsc
Copy link
Author

@karm435
Copy link

karm435 commented Feb 4, 2019

Is there any way to have a shared variable among different configurations?

@edgar-slalom
Copy link

Is there any existing documentation for Multi-Deployments - we got an app that we want to build once and push to a Dev and QA environment each environment with its own set of "testers" (e.g. Collaborators).

@shubhambajoria1993
Copy link

I have react native config library setup with dev, qa, staging and production within the react native. How can i integrate this with app center build?

Hi @jdnichollsc, I think you can achieve it by specifying custom Environment variable with correct deployment key for every branch and then use appcenter-pre-build.sh to write it inside Android or iOS application.

Please, let me know if is was helpful for you situation.

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

No branches or pull requests

7 participants