PolyAPI  >  Learn More  >  Blog

Elevate your CI/CD Pipeline with Project Glide

CI/CD Pipelines

Hello, I’m Aaron from PolyAPI, and I’m excited to unveil Project Glide, our latest innovation aiming to refine the way you build and operate integrations, orchestrations, and microservices with PolyAPI. Project Glide isn’t just a tool; it’s an improved workflow for deploying server functions with precision and control, coming first to our TypeScript users, and to other languages soon.

Streamlining Poly Development

Project Glide seamlessly integrates with your git environment, offering robust source control management that significantly reduces the risk of production errors. Here’s how Project Glide compliments your development and deployment process:

Robust Version Control: Keep every function under strict version control, enabling easier rollback and status checks, enhancing your operational security and stability.

Rapid Deployment Capabilities: With Project Glide, push updates faster than ever, even across vast systems, minimizing risk and boosting your throughput.

Enhanced Metadata Management: Directly manage metadata within your source code for unmatched consistency and control, ensuring deployments are always accurate.

Automation of Routine Tasks: Implement comprehensive automated testing and linting to ensure that every release meets your high standards, simplifying the development process.

Designed for the Modern Enterprise

Leveraging the principles of GitOps, Project Glide enhances collaboration across your development teams by using git pull requests as a management tool for infrastructure updates and software deployments. This methodology speeds up development cycles and ensures a high degree of accuracy and accountability in deployments.

How it’s used

So what does the Project Glide workflow look like? Well it looks a lot like what you might already be used to in a git-driven development process:

You checkout a new branch in your project’s git repository.

You make your changes, let’s say you write a new Poly server function like so:

TypeScript
TypeScriptimport { PolyServerFunction } from "polyapi";

export const polyConfig: 
PolyServerFunction = {  
  name: "helloPoly",  
  context: "demo"  
  logsEnabled: true,
}

export async function 
helloPoly(first_name: string): 
Promise<string> {  
  return `Hello ${first_name}!`;
}

Note the new PolyServerFunction import available from the PolyAPI Node client providing type safety and hints for writing the polyConfig.

You prepare your changes to be committed in git, type out a nice commit message explaining your changes to your team (and to future you looking back through the git change log), and then you commit it.

A pre-commit hook in git fires automatically and runs the poly prepare command for you.

You see that Poly found your new function and prepared it for deployment by adding in some missing documentation which you can review before committing:

TypeScript
/**
* Greet new users of Poly * 
* @param {string} first_name - The user's first name 
* @returns {Promise<string>} A greeting for the user from Poly 
*/

export async function 
helloPoly(first_name: string): 
Promise<string> {

You push your changes to your teams’ central repository on Github, triggering an automated deployment action provided by PolyAPI to run through and sync all your deployments–deploying your new helloPoly function in the process.

You pull the latest from the remote repository after the deploy has finished to see Poly has updated your source code one more time putting a receipt for the deployment at the top of the file:

TypeScript
// Poly deployed @ 2024-09-20T21:58:31.264Z - demo.helloPoly - https://na1.polyapi.io/canopy/polyui/collections/server-functions/f382e9df-d591-4080-93e0-9dc2d0297444 - 75a08d6

import { PolyServerFunction } from "polyapi";…

This receipt shows when the function was deployed, and gives you a link to view it in the PolyAPI web UI where you can review the deployed function, review its logs (if enabled) and manually execute it.

So you just wrote a server function, committed it like normal to your source repository and deployed it to the cloud without needing to spin up any infrastructure of your own, and now your code is linked to the deployed function making it even easier to go from runtime logs to your function code and vice-versa. Pretty cool right?

How it works

Project Glide introduces two pivotal commands to the polyapi node client (and soon to all others):

ShellScript
poly prepare

This command will automatically scan and ready all your Poly functions, and write AI-augmented JSDoc documentation back into your source code exactly as it will be shown in your PolyAPI catalog and in generated SDKs, so you can review and correct if needed before commiting. You can run the prepare command manually anytime you wish, but to really glide see our documentation in the template project below for how to get this command setup in your git pre-commit hook.

ShellScript
poly sync

This command will sync all prepared functions to your PolyAPI instance (adding, updating, or removing deployed functions as needed to bring them into alignment with your source code), and will write detailed receipts for each deployment at the top of your source files giving you full traceability and accountability. You can run this command manually if you’re not using a remote git repository like Github to store your project, but we highly recommend you set up our PolyAPI Deployment Action to manage this command for you and get the most out of Project Glide.

100% automated deployments using the PolyAPI Deployment Action

If you’re working with a team on Github or want to fully automate your deployments so you never need to remember any of the poly commands: we’ve published a Github action which will manage your poly deployments cache, and run poly sync for you from your central github repository. See the template project or the Github marketplace listing for more details.

See it here: https://github.com/marketplace/actions/polyapi-deployment-action.

Ready to Glide?

Begin your journey with Project Glide today by exploring our TypeScript project template here which contains more details to get started: https://github.com/polyapi/poly-glide-template-js

We’d love for you to try it today and send us your feedback. Or just say hi and tell us what you’re working on at hello@polyapi.io.

Share this Article: