What does Google SRE do?

What does Google SRE do? SRE is a separate organization in Google. It has its own reporting structure. The headcount for SREs comes from a dev team. The System Engineer SREs have a background primarily in Linux, kernel…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Deploy to Firebase from Azure DevOps

Create a CI/CD Pipeline for Firebase projects

Firebase is a cloud platform that allows you quickly build and deploy applications. It comes with a CLI tool for adding features and deploying to the Hosting service.

In this article, we’ll go through the following steps to get a deployment to Firebase up and running:

Library Variables

Build Pipeline

Release Pipeline

The dist folder is what we will instruct Firebase to deploy and, as such, is where we would direct the output of a build tool— such as Gulp or Webpack. For the purpose of this article, we will deploy only the default, static content created for us by Firebase initialization.

The firebase.json file was also created for us and contains information about which resources to deploy.

Follow the Hosting URL link shown in the console to view the deployed content on the web.

Firebase variables stored in a Library Variable Group

The CI Token is configured as a secure variable to hide it from the editor and the logs.

For a typical build pipeline there would be many steps to do things such as:

However, in our simple case, we can skip all of those steps as we are only dealing with static content.

Desired structure of the Build artifacts

You can see that the Build Artifacts contains:

I added the following 3 Publish Build Artifacts steps and configured them to create the desired build output.

Build Pipeline containing 3 Publish Build Artifacts tasks

Our release pipeline will be a simple 1-step process. The following diagram of the pipeline shows that we are consuming the release from our build and then deploy it to a single environment named Staging. In our case, the release artifacts will be the artifacts that we created above.

As with the build, the release pipeline is simplified to show only the step required to deploy to Firebase.

The Release pipeline consists of a single PowerShell Script task

As you can see, the deployment is handled by a single PowerShell script. The script is configured to receive 3 inputs:

The key is where firebase deploy is called, passing in the script input parameters as values. The early lines install the Firebase tools and ensure that the script is running in the context of the correct location.

From a Firebase perspective, the deployment is made with the ReleaseNumber showing up as a Release description in the portal.

In this article we saw the bare minimum requirements for how to setup a CI/CD pipeline in Azure DevOps to deploy to Firebase.

Hopefully this will get you started in automating your own releases into Firebase.

If this was an Angular application we would have needed additional steps such as Copy Files to dynamically inject environment configuration information in our build and Token Replacement to switch out configuration values based on whether we are deploying to a Staging or Production environment.

I will explore these topics in a future article where I show how to deploy an Angular application to multiple Firebase environments.

Constructive feedback, opinions and comments are all welcome. Comment here, or hit me up on twitter @digory . Thanks for reading!

Add a comment

Related posts:

I Am Wendy Jackson

I am Wendy Jackson. I am the owner of Alma’s Restaurant, a cozy, casual dining eatery on the Caribbean island of Antigua. The Islands are a mosaic of people, rich with a vast array of cultures. And…

The vision question in the interview

The CEO said. The technical qualifications were mastered by the candidate, but this was a leadership role. The company was looking for a professional who could inspire those around him or her. The…

QR codes. Again. Really??

I hated QR codes. In fact I loathed them. At every company I worked at as a digital marketer I was asked by directors, partners and CEOs: In order to scan them you needed to use a special QR code…