我使用Android移动应用程序,其中源代码在Azure中维护。我要根据要求自动构建过程并在Firebase App Distribution中上载.apk文件。
我使用Azure Pipeline来自动化构建过程。我正在使用.yml文件来自动化该过程。能够生成.apk文件。我需要将其上传到Firebase。
跟随几个博客,最后出现以下需要在我的.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 "[email protected]" $(build.artifactStagingDirectory)$(Build.ArtifactStagingDirectory)/android-devops.apk
displayName: 'npm install and deploy'
有了这个,就无法登录Firebase,因为在运行中将没有任何交互。 Azure在运行作业时完全自动化。如果我在命令提示符下使用了这些命令,它将打开firebase登录页面,并在登录时获得身份验证。之后,appdistribution:distribute
命令将应用程序成功上传到Firebase。但是我需要在没有任何交互的Azure Devops Pipeline中自动化此过程。
请先尝试生成身份验证令牌,然后使用以下两个选项之一:
firebase
命令系统。