From bdcf41e0f27a879922f6157ddcab4c6992a623f3 Mon Sep 17 00:00:00 2001 From: Zack Siri Date: Wed, 25 Oct 2023 16:13:43 +0700 Subject: [PATCH] create bucket --- .github/workflows/ci.yml | 2 +- test/pakman/push_test.exs | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4131c41..5fda716 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: services: minio: - image: lazybit/minio + image: minio/minio:edge-cicd ports: - 9000:9000 env: diff --git a/test/pakman/push_test.exs b/test/pakman/push_test.exs index 3714b70..dd52045 100644 --- a/test/pakman/push_test.exs +++ b/test/pakman/push_test.exs @@ -6,6 +6,28 @@ defmodule Pakman.PushTest do setup do bypass = Bypass.open() + storage = %{ + "host" => "localhost", + "port" => 9000, + "scheme" => "http://", + "region" => "auto", + "bucket" => "test", + "credential" => %{ + "access_key_id" => "minioadmin", + "secret_access_key" => "minioadmin" + } + } + + ex_aws_config = + ExAws.Config.new(:s3, + access_key_id: storage["credential"]["access_key_id"], + secret_access_key: storage["credential"]["secret_access_key"], + host: storage["host"], + port: storage["port"], + scheme: storage["scheme"], + region: storage["region"] + ) + System.put_env("HOME", "test/fixtures") System.put_env("GITHUB_WORKSPACE", "") System.put_env("INSTELLAR_ENDPOINT", "http://localhost:#{bypass.port}") @@ -13,6 +35,9 @@ defmodule Pakman.PushTest do System.put_env("WORKFLOW_SHA", "somesha") System.put_env("GITHUB_REPOSITORY", "upmaru-stage/locomo") + ExAws.S3.put_bucket(storage["bucket"], storage["region"]) + |> ExAws.request(Keyword.new(ex_aws_config)) + {:ok, bypass: bypass} end