Giter VIP home page Giter VIP logo

codebuild_locally's Introduction

개요

AWS CodeBuild를 로컬에서 실행


쉘 스크립트 다운로드 방법

git clone https://github.com/aws/aws-codebuild-docker-images.git
cd ./aws-codebuild-docker-images/local_builds

ls -l codebuild_build.sh

쉘 스크립트 실행 방법

도커 이미지 pull

  • Agent 도커 이미지
# For x86_64
docker pull public.ecr.aws/codebuild/local-builds:latest

# For ARM(or MacOS)
docker pull public.ecr.aws/codebuild/local-builds:aarch64
  • Build 도커 이미지
# x86
docker pull public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:5.0-23.07.28

# ARM
docker pull public.ecr.aws/codebuild/amazonlinux2-aarch64-standard:3.0

쉘 스크립트 실행권한 설정

chmod u+x codebuild_build.sh

쉘 스크립트 실행 인자: -i-a는 필수

./codebuild_build.sh \
	-i <Build-container-image-name> \
	-a <artifact-output-directory> \
	-l <Agent-container-image-name> \
	-s <project-code-directory>

실행 예(ARM계열 도커 이미지 사용)

# MacOS
./codebuild_build.sh \
	-i public.ecr.aws/codebuild/amazonlinux2-aarch64-standard:3.0 \
	-l public.ecr.aws/codebuild/local-builds:aarch64 \
	-a artifacts \
	-s ./example-1

예제

예제1. echo helloworld

./codebuild_build.sh \
	-i public.ecr.aws/codebuild/amazonlinux2-aarch64-standard:3.0 \
	-l public.ecr.aws/codebuild/local-builds:aarch64 \
	-a artifacts \
	-s ./example-1

예제2. put item to s3

  • IAM Role생성하고 AWS profile설정 후 실행
# AWS profile 설정 예
$ cat ~/.aws/config
[default]
region = ap-northeast-2

[profile codebuild]
source_profile = default
role_arn = arn:aws:iam::xxxxxxxx:role/CodeBuild-locally-demo

# CodeBuild 로컬 실행(MacOS)
./codebuild_build.sh \
	-i public.ecr.aws/codebuild/amazonlinux2-aarch64-standard:3.0 \
	-l public.ecr.aws/codebuild/local-builds:aarch64 \
	-a artifacts \
	-c \
	-p codebuild \
	-s ./example-2

참고자료

codebuild_locally's People

Contributors

choisungwook avatar

Stargazers

Jinsoo Jeong avatar nanamix avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.