Bitbucket is getting a new navigation

We’re rolling out these changes, so the documentation may not match your experience in the Bitbucket Cloud app. Read about the new Bitbucket navigation

AWS S3 へのデプロイ

The following guide shows how to deploy your files to an AWS S3 bucket using the aws-s3-deploy pipe in Bitbucket Pipelines.

前提条件:

  • デプロイメント アーティファクトがコピーされる AWS S3 バケットをセットアップしていること。

  • AWS S3 バケットへのアーティファクトのアップロードを行うための十分な権限が構成されている IAM ユーザー。

手順

  1. Add your AWS credentials to Bitbucket Pipelines. In your repository, go to Repository settings, under Pipelines, select Repository variables and add the following variables. Learn more on how to configure Pipelines variables.

    Basic usage variables 

    • AWS_ACCESS_KEY_ID (*): ご利用の AWS アクセス キー。

    • AWS_SECRET_ACCESS_KEY (*): ご利用の AWS シークレット アクセス キー。保護された変数として保存する必要があります。

    • AWS_DEFAULT_REGION (*):  The AWS region code (us-east-1, us-west-2, etc.) of the region containing the AWS resource(s). For more information, The AWS region code (us-east-1, us-west-2, etc.) of the region containing the AWS resource(s). For more information, see Regions and Endpoints.

  2. CI/CD 構成をセットアップします。

    image: atlassian/default-image:2 pipelines: default: - step: name: Build artifact script: - mkdir artifact - echo "Pipelines is awesome!" > artifact/index.html artifacts: - artifact/* - step: name: Deploy to S3 deployment: production script: - pipe: atlassian/aws-s3-deploy:0.3.8 variables: AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY AWS_DEFAULT_REGION: 'us-east-1' S3_BUCKET: 'bbci-example-s3-deploy' LOCAL_PATH: 'artifact' ACL: 'public-read'

    Note: aws-s3-deploy pipe can be mixed with other pipes to create your awesome CI/CD.

  3. アプリケーションを本番環境にデプロイします。アプリケーションのコードを Bitbucket リポジトリにプッシュし、それによってパイプラインをトリガーします。[Pipelines] を選択して、パイプラインの進捗を確認できます。

    これで、ユーザーはファイルを S3 バケットで検証し、優れたアプリケーションのビルドに集中して取り組みながら、その他の作業を Bitbucket Pipelines で処理できるようになりました。

A full end-to-end example is available in this example repository. if you prefer more hands-on experimentation with deploying to your AWS S3 bucket using Pipelines and Pipes.

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。