For our hosting situation on <https://github.com/t...
# github-workflows-kt
l
For our hosting situation on https://github.com/typesafegithub/github-workflows-kt/issues/571 I have a personal server where I host my tech stack. I could easily host our simple jvm app there if you have an idea on how to build it into a dockerfile
K 1
p
That's really awesome, thanks! 🙇 The next step would be to wrap the script-generator into a Web server and build a frontend. @jmfayard @Nikky do you want to contribute here? Would be nice to start with a little design - a sketch of UI, then the backend API will emerge
@LeoColman how would you like us to deploy it? would you like to get a reference to the Docker image somewhere in public repo and deploy it manually, or we could set up some automated CD (needs a way to auth with your server)?
l
Making it runnable with Docker would be much easier. https://github.com/LeoColman/MyStack I use docker-compose for all my stuff, so I'll probably come up with an image to be deployed in the same way if we don't make it official part of the repository
Making it runnable with Docker would be much easier.
This seems interesting for other people to host it too, or whenever we find an official supporter/donor
p
Sure, I'm also for dockerizing it, I'm wondering what's next. We have an image and who actually deploys it
I guess we can consider publishing it to DockerHub and you could consume it from there using your infra, sounds good?
l
Yep, sounds perfect
I have my personal domain
<http://colman.com.br|colman.com.br>
and can create a
<http://github-workflows-kt.colman.com.br|github-workflows-kt.colman.com.br>
if we don't have a domain to point there. The best alternative would be to point another domain there when we have one
j
Thanks, I updated the issue
p
@LeoColman I've put together a very hacky first version of the dockerized script generator, for now only with REST API, no UI yet. Feel free to put it on your hosting whenever you have a moment 🙂
Copy code
> docker run -p 8080:8080 -d krzema12/github-workflows-kt-script-generator-server:0.41.0
> curl '<http://localhost:8080/api/yaml-to-kotlin>' -X POST -H 'Content-Type: application/json' -d "{\"yaml\": \"name: Test\non:\n  push:\"}" | sed 's/\\n/\n/g'
{"kotlinScript":"#!/usr/bin/env kotlin

@file:DependsOn(\"io.github.typesafegithub:github-workflows-kt:0.41.0\")

import io.github.typesafegithub.workflows.domain.Workflow
import io.github.typesafegithub.workflows.domain.triggers.Push
import io.github.typesafegithub.workflows.dsl.expressions.expr
import io.github.typesafegithub.workflows.dsl.workflow
import io.github.typesafegithub.workflows.yaml.toYaml
import io.github.typesafegithub.workflows.yaml.writeToFile
import java.nio.`file`.Paths

public val workflowTest: Workflow = workflow(
      name = \"Test\",
      on = listOf(
        Push(),
        ),
      sourceFile = Paths.get(\".github/workflows/test.main.kts\"),
    ) {
    }

workflowTest.writeToFile()"}
l
Nice! I'll do that 🙂
Done
Copy code
curl '<https://github-workflows-kt.colman.com.br/api/yaml-to-kotlin>' -X POST -H 'Content-Type: application/json' -d "{\"yaml\": \"name: Test\non:\n  push:\"}" | sed 's/\\n/\n/g'
p
cool! now we need a simple UI, I’ll likely add it in the next days and ask you for a re-deploy. BTW, how time-consuming for you is to redeploy the image?
l
<= 5 minutes
It's bumping the version and making a commit
I can even set it to "latest" if you are feeling brave xD
Then it would automatically update once every 24h
p
there’s no
latest
tag yet 🙈 but yeah, we can consider it in the “moving fast” dev phase of this tool
will let you know, thanks!