Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F113586
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/test/builds-sr-ht.exs b/test/builds-sr-ht.exs
deleted file mode 100644
index 7f7c7f8..0000000
--- a/test/builds-sr-ht.exs
+++ /dev/null
@@ -1,52 +0,0 @@
-name =
- case System.cmd("git", ~w(describe --all --long --dirty --broken --always)) do
- {name, 0} -> String.trim(name)
- _ -> "cannot-git-describe"
- end
-
-repo = System.get_env("TEST_REPO") || "https://git.sr.ht/~href/gen_magic"
-
-IO.puts("Using repository: #{repo}")
-
-token = System.get_env("SR_HT_TOKEN")
-
-unless token do
- IO.puts("""
- sr.ht token not defined (SR_HT_TOKEN)\n\n
- Get one at https://meta.sr.ht/oauth/personal-token\n
- Define one by setting the SR_HT_TOKEN environment variable
- """)
-else
- Application.ensure_all_started(:ssl)
- Application.ensure_all_started(:inets)
-
- File.ls!(".builds")
- |> Enum.filter(fn file -> Path.extname(file) == ".yaml" end)
- |> Enum.each(fn file ->
- file = Path.join(".builds", file)
- build = Path.basename(file, ".yaml")
-
- build =
- %{
- "manifest" => File.read!(file),
- "note" => "gen_magic/#{name} #{build}",
- "tags" => ["gen_magic"]
- }
- |> Jason.encode!()
-
- case :httpc.request(
- :post,
- {'https://builds.sr.ht/api/jobs', [{'authorization', 'token ' ++ to_charlist(token)}],
- 'application/json', build},
- [],
- []
- ) do
- {:ok, {{_http_v, 200, 'OK'}, _headers, body}} ->
- resp = Jason.decode!(body)
- IO.puts("#{resp["status"]} job #{resp["note"]}, id: #{resp["id"]}")
-
- error ->
- IO.puts("Failed to enqueue job #{inspect(error)}")
- end
- end)
-end
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 11:41 AM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39776
Default Alt Text
(1 KB)
Attached To
Mode
R20 majic
Attached
Detach File
Event Timeline
Log In to Comment