2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Github Actions でテスト用のS3を使う

Posted at
.github/workflows/s3-local.yml
name: s3-local

on:
  pull_request:

jobs:
  s3:
    runs-on: ubuntu-18.04
    steps:
      - name: run minio
        run: |
          docker run -d -p 9000:9000 --name minio \
                     -e "MINIO_ACCESS_KEY=ABCDEFGHIJKLMN" \
                     -e "MINIO_SECRET_KEY=0123456789" \
                     -v /tmp/data:/data \
                     -v /tmp/config:/root/.minio \
                     minio/minio server /data
      - name: check s3 command
        env:
          AWS_ACCESS_KEY_ID: "ABCDEFGHIJKLMN"
          AWS_SECRET_ACCESS_KEY: "0123456789"
        run: |
          echo "hello" > ~/test.txt
          cat ~/test.txt
          aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test-bucket # make bucket
          aws --endpoint-url http://127.0.0.1:9000/ s3 ls
          aws --endpoint-url http://127.0.0.1:9000/ s3 cp ~/test.txt s3://test-bucket # cp
          aws --endpoint-url http://127.0.0.1:9000/ s3 ls s3://test-bucket # ls
          aws --endpoint-url http://127.0.0.1:9000/ s3 cp s3://test-bucket/test.txt - # check content
          aws --endpoint-url http://127.0.0.1:9000/ s3 rm s3://test-bucket/test.txt # rm object
          aws --endpoint-url http://127.0.0.1:9000/ s3 rb s3://test-bucket # remove bucket
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?