[Vuejs]-Continuous Integration: Deploy to different Firebase projects from one repository

0👍

Answer

Webpack

Webpack makes it possible to configure Client API Keys for different environments, like Prod or Dev.

I created this project with vue-cli and chose the webpack option. This creates folders and files to configure Continuous Integration for multiple environments.

In my specific case, I saved my two Client API Keys in dev.env.js and prod.env.js. These .js files are in the config folder created by vue-cli.

I used This Tutorial to gain an understanding of how Webpack uses files in the build folder. For vue-cli, keep and eye on NODE_ENV and '"production"'

More

There are other Secret API Keys that this application needs access to when deploying. For this, I use Environmental Variables in Bitbucket Pipelines. Although Bitbucket Pipelines uses Docker Images to build and deploy, it is the bitbucket-pipelines.yml that can reference encrypted environmental variables from Bitbucket, i.e., $PROD_FIREBASE_API_KEY, $DEV_FIRBASE_API_KEY.

Leave a comment