Adding Google-services.json for CircleCI to function, on a public repository

匆匆过客 提交于 2020-01-23 14:29:17

问题


I've linked my Android project repository to CircleCI and when I build, I got an gradlew lint error saying that google-services.json is not present. Is there any way to add google-services.json to my project, without committing it to the repository?

I'm using firebase as backend for my project


回答1:


disclaimer: CircleCI Developer Advocate

I'm not too familiar with google-services.json so I'll mention a few possible solutions and you can see what might work best for you.

  1. If the file is small enough, you can base64 encode the file, store it on CircleCI as a private environment variable, and then during a build decode the variable back to the file.

  2. If an API key is the only secret part of the file, you could store the API key in a private environment variable, replace it in the file with template text such as %API_KEY%, and then during a build, replace the template text with the key using sed.

  3. Encrypt the entire file before committing it and store the decrypt key as a private environment variable.

  4. Store the file somewhere secure and use SSH to retrieve it during a build.

Useful links: - CircleCI Environment Variables - sed - base64



来源:https://stackoverflow.com/questions/50671196/adding-google-services-json-for-circleci-to-function-on-a-public-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!