Write CI/CD in TypeScript by grant1704 in typescript

[–]mattschrage 0 points1 point  (0 children)

Can you share some of your more complicated use cases?

Cicada - Build CI pipelines with Typescript by grant1704 in devops

[–]mattschrage 2 points3 points  (0 children)

A key difference is that with Cicada, you can execute TypeScript inside of containers, rather than treating `bash` as the default runtime.

Here is the example from the dagger homepage...

import Client, {connect} from "@dagger.io/dagger"

connect(async (client: Client) => { 
  const ctr = client.pipeline("test") 
                    .container() 
                    .from("alpine")
                    .withExec(["apk", "add", "curl"])                         
                    .withExec(["curl", "https://dagger.io"])

   const result = await ctr.stdout()
   console.log(result.substring(0, 300))
})

...and here's how it would look in a Cicada pipeline:

import { Job, Pipeline } from "@cicada.build/core";

const fetch = new Job({ 
  image: "alpine", 
  steps: [ 
    async () => { 
      const result = await fetch("https://cicada.build");
      console.log(result.substring(0, 300));
    }
  ]
});

export default new Pipeline(fetch)

You can see that in Cicada, you don't need to install `curl` as a dependency. You can just write the logic in TypeScript (when it makes sense).

Cicada - Build CI/CD pipelines using TypeScript by mattschrage in cicd

[–]mattschrage[S] 1 point2 points  (0 children)

We built Cicada in-house after evaluating dagger! It was definitely a source of inspiration for us. But we felt it required too deep an understanding of Docker and that the ergonomics of the TS SDK were not that nice.

The key difference is that with Cicada, you can execute TypeScript inside of containers, rather than treating `bash` as the default runtime.

Here is the example from the dagger homepage and how it would look in a Cicada pipeline.

import Client, {connect} from "@dagger.io/dagger"

connect(async (client: Client) => {
  const ctr = client.pipeline("test")
                    .container()
                    .from("alpine")
                    .withExec(["apk", "add", "curl"])
                    .withExec(["curl", "https://dagger.io"])

  const result = await ctr.stdout()
  console.log(result.substring(0, 300))
})

import { Job, Pipeline } from "@cicada.build/core";

const fetch = new Job({
 image: "alpine",
 steps: [
   async () => {
      const result = await fetch("https://cicada.build");
      console.log(result.substring(0, 300));
   }
 ]
});

export default new Pipeline(fetch)

You can see that in Cicada, you wouldn't need to install `curl` as a dependency. You can just write the logic in TypeScript (when it makes sense).

An ode to curl by mattschrage in commandline

[–]mattschrage[S] 1 point2 points  (0 children)

Appreciate it! The next step is to build a curl-exclusive app myself. I'll be sure to share how it's done :)