[英]Authenticate and use Firebase in non-interactive environments
I work with Android mobile application, where source code is maintained in Azure.我使用 Android 移动应用程序,其中源代码保存在 Azure 中。 I want to automate the build process and upload the.apk file in Firebase App Distribution , as per the requirment.
我想根据要求自动化构建过程并在Firebase App Distribution中上传 .apk 文件。
I used Azure Pipeline to automate the build process.我使用Azure 管道来自动化构建过程。 Am using .yml file to automate the process.
我正在使用.yml文件来自动化该过程。 Were able to generate the.apk file.
能够生成.apk文件。 I need to upload this to Firebase.
我需要将此上传到 Firebase。
Followed few blogs and ends up with below code that needs to be written in my.yml file关注了几个博客,最后得到了下面需要写在 my.yml 文件中的代码
- script: |
cd functions
npm init --yes
npm install -g firebase-tools
npm install
firebase login --interactive
firebase appdistribution:distribute --app APP_ID --release-notes "My first distribution" --testers "xyzh@gmail.com" $(build.artifactStagingDirectory)$(Build.ArtifactStagingDirectory)/android-devops.apk
displayName: 'npm install and deploy'
With this, couldn't login into firebase, since there will be no interaction on run.有了这个,无法登录到 firebase,因为运行时不会有交互。 It is completely automated by Azure on running the job.
Azure 在运行作业时完全自动化。 If I used these commands in command prompt, it open firebase login page and on login it got authentication.
如果我在命令提示符下使用这些命令,它会打开 firebase 登录页面并在登录时获得身份验证。 After that
appdistribution:distribute
command uploads the application to Firebase successfully.之后
appdistribution:distribute
命令成功将应用程序上传到 Firebase。 But I need to automate this process in Azure Devops Pipeline, where there will be no interactions.但是我需要在 Azure Devops Pipeline 中自动化这个过程,在那里不会有任何交互。
Please try to generate an authentication token first, and then use either of the following two options:请先尝试生成身份验证令牌,然后使用以下两个选项之一:
firebase
commands with the --token flag in your CI system.firebase
命令。 https://firebase.google.com/docs/cli/#command_reference https://firebase.google.com/docs/cli/#command_reference
I just used firebase login:ci --interactive
and worked great for me我刚刚使用
firebase login:ci --interactive
并且对我很有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.