-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (46 loc) · 1.24 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.PHONY: all help clean push test build
export VERSION = 1.0.6
export AWS_DEFAULT_REGION = us-east-1
define AWS_CLI_CMD
docker container run --rm -i \
-e AWS_ACCESS_KEY_ID \
-e AWS_DEFAULT_REGION \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_SESSION_TOKEN \
amazon/aws-cli:latest
endef
build: ## Create the docker image.
@echo "--- :wind_chime: Building :wind_chime:"
docker run \
--rm \
--workdir=/app \
-v `pwd`:/app \
-e VERSION \
ruby:3.1 \
gem build fluent-plugin-annotation-filter.gemspec
test: ## Run the app tests.
@echo "--- :fire: Testing :fire:"
docker run \
--rm \
--workdir=/app \
-v `pwd`:/app \
-e VERSION \
-e BUNDLE_PATH=/app/gems \
ruby:3.1 \
script/docker-rspec.sh
push: build ## Publish the gem
@echo "--- :fire: Pushing! :fire:"
docker run \
--rm \
--workdir=/app \
-v `pwd`:/app \
-e VERSION \
-e BUNDLE_PATH=/app/gems \
-e GEM_HOST_API_KEY=$$(${AWS_CLI_CMD} secretsmanager get-secret-value --secret-id rubygems_api_key --output json | jq -r '.SecretString | fromjson | .rubygems_api_key') \
-it \
ruby:3.1 \
script/push-gem.sh
clean: ## Cleanup artifacts generated by build.
@echo "--- :shower: Cleaning up :shower:"
-rm *.gem
all: build test push