Cloud Engineer Setup Guide
Welcome to the Cloud Engineer Setup Guide for m00m world! This guide will help you configure your cloud development environment, set up necessary tools, and get you ready to contribute to our cloud infrastructure.
Prerequisites
- Git: Ensure you have Git installed on your machine. You can download it from git-scm.com.
- We recommend using Git 2.39 or higher.
- 🍎 Mac users can use
brew install gitto install Git via Homebrew.
- Docker: Install Docker Desktop from docker.com to manage containerized applications.
- Node.js: Install Node.js from nodejs.org for running JavaScript applications.
- We recommend using Node Version Manager
- WebStorm: Download and install WebStorm for cloud development.
- Firebase CLI: Install the Firebase CLI by running
npm install -g firebase-toolsin your terminal.
Step 1: Clone the Cloud Project Repository
- Open a terminal or command prompt.
- Ensure you have Git installed and configured. You can check by running
git --version. - Ensure you have proper SSH credentials set up for GitHub on your machine. Follow GitHub's guide if needed.
- Navigate to the directory where you want to clone the repository, e.g.,
~/m00m/.
> git clone git@github.com:m00m-world/m00m-functions.git CloudFunctions
> cd CloudFunctions
> npm install
- This will clone the Cloud Functions repository and install the necessary dependencies.
- Open the cloned project in WebStorm.
Step 2: Configure Firebase
- Open the terminal (WebStorm or System).
- Run
firebase loginto authenticate with your Google account.
Test Changes Locally
- To test your changes locally, run:
> firebase emulators:start
- This will start the Firebase emulators for functions, Firestore, and other services you have configured.
- You can test your functions by making HTTP requests to the local emulator endpoints.
- Make sure to check the logs in the terminal for any errors or output from your functions.
- You can also use tools like Postman or cURL to test your HTTP functions locally.
- If you need to test Firestore interactions, you can use the Firebase Emulator UI by navigating to
http://localhost:4000in your web browser. - Make sure to test all your functions thoroughly before deploying them to production.
Deploy
To deploy your changes, run the following from the root CloudFunctions directory
Development Production
> ./deploys/development.sh --target {ApiWrapper.js Child Key}
warning
It is important to only deploy a small segment key at a time, as deploying the entire codebase can lead to issues with the Firebase environment. Always test your changes locally before deploying to production.
Production Deployment
> ./deploys/production.sh --target {ApiWrapper.js Child Key}