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

Azure code push server to be used for multiple different react native apps? #46

Closed
jerinjohnk opened this issue Nov 16, 2024 · 11 comments
Closed

Comments

@jerinjohnk
Copy link

We created a Resource Group and deployed api folder to Azure for the codepush server.
I can add android and ios apps here using

code-push-standalone app add

Now, we have different apps in our organization that require this codepush server setup. Would you suggest

  1. We should create different groups for each RN App with codepush server setup- so it's easier to delete them if needed.
    Or
  2. Add these different apps to the same resource; if so, how can we manage later once we require the deletion of an app and its uploaded builds?
    The below code will delete the app, but will it also delete its associated packages?

code-push-standalone collaborator rm

Please let me know if I am on the right track.
If we opt for the second method, the email used to access the resource can be considered the admin.
The admin can add all apps to the resource.
Then, they can add collaborators to each app to access their particular app.
So, are collaborators assigned admin roles? Can they delete the app?

@rahman2835
Copy link

@jerinjohnk my name is Rahman and I'm also trying to deploy code-push-server into azure. Can you please share me the exact steps?

@jerinjohnk
Copy link
Author

For Now we are creating different resources across different teams to keep resources separate

@rahman2835
Copy link

@jerinjohnk I'm new to Azure and trying to deploy code-push-server into Azure app services. To do this, I'm following their documentation
https://github.com/microsoft/code-push-server/blob/main/api/README.md.

is this good enough?

@jerinjohnk
Copy link
Author

jerinjohnk commented Jan 17, 2025

Hi, @rahman2835; for local deployment, I found this Medium article to give enough details.
For Azure deployment
Get an Azure resource created by the DevOps team.
Change/create a new ClientID and Secret Key.
https://<resource-group-name>.azurewebsites.net
https://<resource-group-name>.azurewebsites.net/auth/callback/github

You can add your secret key values inside api/parameters.json
Then you can deploy it to Azure using.
az deployment group create --resource-group <resource-group-name> --template-file ./codepush-infrastructure.bicep --parameters ./parameters.json

Instead of running the long code
az deployment group create --resource-group <resource-group-name> --template-file ./codepush-infrastructure.bicep --parameters project_suffix=<project-suffix> az_location=<az-location eg. eastus> github_client_id=<github-client-id> github_client_secret=<github-client-secret> microsoft_client_id=<microsoft-client-id> microsoft_client_secret=<microsoft-client-secret>

For the first time or after syncing the codepush repo, you must deploy/redeploy the api folder to Azure.
The details can be found here
#40
So that when you visit
https://<resource-group-name>.azurewebsites.net
you see the below message instead of deployment is pending
Welcome to the CodePush REST API!

After it's done, you can register and log in using the resource URL.

Haven't tried adding the Redis server for metrics for now.

@rahman2835
Copy link

rahman2835 commented Jan 17, 2025

@jerinjohnk Thank you so much for your quick reply. I have same app for iOS, Android and Windows. For each app I can use same Server URL to add or register right ? I mean

code-push-standalone register <optional: server-url> (http://localhost:3000)

code-push-standalone app add MyApp-Android
code-push-standalone app add MyApp-iOS
code-push-standalone app add MyApp-Windows

one more question, for OAuth I can use only GithHub right ? No need of Microsoft OAuth details?

@jerinjohnk
Copy link
Author

Yes, you can keep the same <optional: server-url> => https://.azurewebsites.net.
You can add as many apps as you want to this resource.

code-push-standalone app add <appName>

We opted to keep different team resources separate as we have different apps in our organization.
Each team can upload their app's different Platform(iOS, Android and Windows) versions in their own resource.

Yes, GitHub will suffice.
GitHub and Microsoft are used as Identity Managers to verify your login. Adding both just adds an extra option to validate your session login. Not needed.

@rahman2835
Copy link

@jerinjohnk thank you so much. It helps a lot for my deployment process.

@rahman2835
Copy link

@jerinjohnk I deployed using VS code. But I ran following commands before I deploy.

npm install
npm run build

Above commands will create bin folder and node_modules folder. Currently I uploaded all these files. So my question is, do we need to upload node modules also.

What if I wanted to deploy using github repo?

I'm really sorry for all these questions.

@jerinjohnk
Copy link
Author

What do u mean you uploaded all the files?
The az deployment group create --resource-group <resource-group-name> --template-file ./codepush-infrastructure.bicep --parameters ./parameters.json command creates the required services inside the Azure resource.
You just need to deploy the api folder to Azure.

  1. In VS Code add Azure App Service extension.
    Login to your account.
    Under your resource, select App Services -> Right-click on your resource and select Deploy to Web App, followed by selecting the location of the api folder.

@rahman2835
Copy link

@jerinjohnk yes followed these steps and able to see Welcome to the CodePush REST API!

@rahman2835
Copy link

@jerinjohnk any suggestions for this ticket.

#86

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

No branches or pull requests

2 participants