Skip to content

ci-fairy: MinIO client for `ls` and `cp`

Benjamin Tissoires requested to merge bentiss/ci-templates:wip/minio into master

For mesa/mesa!5428 (merged), we want to use STS token on the MinIO server we set up on packet.

However, the mc CLI doesn't support those STS token, and we can not simply use it for those operations.

Add a quick and dirty (but tested) mc like to ci-fairy so people can use the gitlab CI job JWT token to securely talk to MinIO.

Examples of uses are (extracted from my tests at https://gitlab.freedesktop.org/bentiss/test-minio/-/jobs/3187059):

 # login with our JWT token
 $ ci-fairy minio login $CI_JOB_JWT

 # test some ls commands
 $ ci-fairy minio ls minio:/
 artifacts
 git-cache
 $ ci-fairy minio ls minio:git-cache
 bentiss
 mesa
 $ ci-fairy minio ls minio:git-cache/
 bentiss
 mesa
 $ ci-fairy minio ls minio:git-cache/test.txt
 $ ci-fairy minio ls minio:git-cache/this-file-does-not-exists
 $ ci-fairy minio ls minio:git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME
 master.tar.gz
 $ ci-fairy minio ls minio:git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz

 # create a zip file...
 $ git archive --format tar.gz HEAD > $CI_COMMIT_REF_NAME.tar.gz

 # ... and upload it ...
 $ ci-fairy minio cp $CI_COMMIT_REF_NAME.tar.gz minio:git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME.tar.gz

 # ... and download it
 $ ci-fairy minio cp minio:git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME.tar.gz /tmp/cp-test.tar.gz

Merge request reports

Loading