diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b8710a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e109a7a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM golang:1.22.3-bookworm AS builder +WORKDIR /app +RUN git clone https://github.com/fujiwara/aws-sdk-client-go.git . +RUN rm -f gen.yaml +ENTRYPOINT ["./build-in-docker.sh"] diff --git a/Makefile b/Makefile index 41f157a..2e0bce2 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION := $(shell git describe --abbrev=0 --tags) +VERSION := $(shell git describe --tags) .PHONY: clean test gen build: gen aws-sdk-client-go diff --git a/build-in-docker.sh b/build-in-docker.sh new file mode 100755 index 0000000..89793bc --- /dev/null +++ b/build-in-docker.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e +git pull +if [[ $GIT_REF != "" ]]; then + git checkout --detach $GIT_REF +fi +make clean +make +echo 'Completed. Please extract /app/aws-sdk-client-go from this container!' +echo 'For example, run the following command:' +echo 'docker cp $(docker ps -lq):/app/aws-sdk-client-go .' +echo ''