-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use custom Dagger function instead
- Loading branch information
1 parent
b69a9e5
commit 789086c
Showing
8 changed files
with
508 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "whohacks", | ||
"sdk": "python", | ||
"source": "dagger", | ||
"engineVersion": "v0.11.2" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/sdk/** linguist-generated |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/sdk |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[project] | ||
name = "main" | ||
version = "0.0.0" | ||
dependencies = [] | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import dagger | ||
from dagger import dag, function, object_type | ||
|
||
|
||
@object_type | ||
class Whohacks: | ||
@function | ||
async def build_and_push( | ||
*, | ||
git_ref: str, | ||
git_commit: str, | ||
registry: str, | ||
image_name: str, | ||
registry_user: str, | ||
registry_token: dagger.Secret, | ||
) -> str: | ||
ctr = ( | ||
dag.container() | ||
.build(dag.host().directory("."), dockerfile="docker/web/Dockerfile") | ||
.with_registry_auth(registry, registry_user, registry_token) | ||
) | ||
|
||
full_name = f"{registry}/{image_name}" | ||
await ctr.publish(f"{full_name}:dev-{git_commit}") | ||
|
||
if git_ref == "refs/heads/master": | ||
await ctr.publish(f"{full_name}:latest") |
This file was deleted.
Oops, something went wrong.