I am using this documentation - [Preformatted text](https://circleci.com/docs/deploy-to-firebase/)
for deploying my react app to firebase. However, it always fails with following error:
/bin/bash: line <>: firebase: command not found
Error:
Exited with code exit status 127
I have seen other issues related to firebase deployment but they all use old approach of fetching firebase token. What can I do to fix this?
OK after some R&D, unless I am missing something I can not see how that example would work. My reasoning is as follows
The docs state that you can not install firebase-tools globally and instead have to install them locally as part of the npm environment.
The example then goes and uses firebase as if it is an executable that the shell can find in its path - indicating that the executable has been installed into a bin directory somewhere or that the npm install process has gone and started to modify things like the path environment variable.
When using the debug mode of npm install there is no indication that it is handling the firebase package any differently to any other npm package and so no wider environmental changes are taking place.
I can find no examples on the internet of what is being shown in the CircleCI docs, instead a ālocalā install of firebase tools needs to be accessed via an ānpm execā command
Reworking your config.yml file a bit I have the following example
As I have no project I create a package lock file
I output the version of firebase rather than try a deploy
I am not sure what you mean by āseparateā. Each of the 2 jobs defined are run as independent jobs within independent environments.
If you want to just run one or other of the defined jobs, you would do this by using conditional checks within the workflow: section of the config.yml file. A good starting place would be
Once you have spent some time in the docs you will find that you can base conditions on the following
parameters, this works well if you are starting a workflow via the API or web console.
branch name, if you use a GitFlow model this can work well.
tag, you set a tag on a commit. This has the advantage of a workflow only starting if a tag is added.
There is also what is known as the continuation ORB. This allows a config.yml to run a workflow that performs work, such as retrieving environmental info and then call another config.yml file. This allows you to get a value and pass it as a parameter, which can then be used in a condition check.
You might be right but I tried with all the possibilities a path can be defined. As per documentation, it expects path to json file which is at root of my project directory.
I have tried ā./credentials.jsonā, ā/project/credentials.jsonā, ā/root/credentials.jsonā
I dont know what I am missing here.
And for the above question, I will try to use workspaces.
I was finally able to deploy successfully.
The major trigger was storing and retrieving json file from circleci. I stored an encoded string and decoded the same before deployment. And that worked.