Last active
December 14, 2024 16:17
-
-
Save bardic/2448ac0667622141aadb6975fc86d3fc to your computer and use it in GitHub Desktop.
dagger ijhttp example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func (i *Integration) Test(server, test *dagger.Directory) (string, error) { | |
| serverService := dag.Container(). | |
| From("golang:latest"). | |
| WithDirectory("/src", server). | |
| WithExposedPort(1323). | |
| WithWorkdir("/src/server"). | |
| WithExec([]string{"go", "run", "main.go"}). | |
| AsService() | |
| return dag.Container(). | |
| From("alpine:latest"). | |
| WithDirectory("/workdir", test). | |
| WithExec([]string{"apk", "add", "openjdk17-jdk", "curl", "unzip"}). | |
| WithExec([]string{"/bin/sh", "-c", "mkdir /ijhttp"}). | |
| WithExec([]string{"curl", "-f", "-L", "-o", "/ijhttp/ijhttp.zip", "https://jb.gg/ijhttp/latest"}). | |
| WithExec([]string{"unzip", "/ijhttp/ijhttp.zip"}). | |
| WithExec([]string{"/bin/sh", "-c", "chmod +x /ijhttp/ijhttp"}). | |
| WithServiceBinding("server", serverService). | |
| WithExec([]string{"sh", "/ijhttp/ijhttp", "/workdir/test.http"}). | |
| Stdout(context.Background()) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment