Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@ build:
build-init:
docker build $(DOCKER_BUILD_FLAGS) --build-arg AL_TAG=${AL_TAG} -t amazon/aws-for-fluent-bit:build-init -f ./scripts/dockerfiles/Dockerfile.build-init .

#TODO: the bash script opts does not work on developer Macs
windows-plugins: export OS_TYPE = windows
linux-plugins: export OS_TYPE = linux

.PHONY: windows-plugins
windows-plugins: export OS_TYPE = windows
windows-plugins:
./scripts/build_plugins.sh \
--KINESIS_PLUGIN_CLONE_URL=${KINESIS_PLUGIN_CLONE_URL} \
Expand All @@ -65,6 +62,7 @@ windows-plugins:
--DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS}

.PHONY: linux-plugins
linux-plugins: export OS_TYPE = linux
linux-plugins:
./scripts/build_plugins.sh \
--KINESIS_PLUGIN_CLONE_URL=${KINESIS_PLUGIN_CLONE_URL} \
Expand All @@ -76,7 +74,8 @@ linux-plugins:
--CLOUDWATCH_PLUGIN_CLONE_URL=${CLOUDWATCH_PLUGIN_CLONE_URL} \
--CLOUDWATCH_PLUGIN_TAG=${CLOUDWATCH_PLUGIN_TAG} \
--CLOUDWATCH_PLUGIN_BRANCH=${CLOUDWATCH_PLUGIN_BRANCH} \
--DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS}
--DOCKER_BUILD_FLAGS=${DOCKER_BUILD_FLAGS} \
--AL_TAG=${AL_TAG}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation seems off

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, whitespace mysteries, can fix


# Debug and debug init images
.PHONY: main-debug
Expand Down
10 changes: 9 additions & 1 deletion scripts/build_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ARGUMENT_LIST=(
"CLOUDWATCH_PLUGIN_TAG"
"CLOUDWATCH_PLUGIN_BRANCH"
"DOCKER_BUILD_FLAGS"
"AL_TAG"
)

# A variable to hold the build arguments for docker build
Expand All @@ -43,13 +44,14 @@ KINESIS_PLUGIN_TAG=""
FIREHOSE_PLUGIN_TAG=""
CLOUDWATCH_PLUGIN_TAG=""

AL_TAG=""

# Method to display usage of the script
usage() {
echo "Usage: $0 [--KINESIS_PLUGIN_CLONE_URL <string>] [--KINESIS_PLUGIN_TAG <string>] [--KINESIS_PLUGIN_BRANCH <string>]\
[--FIREHOSE_PLUGIN_CLONE_URL <string>] [--FIREHOSE_PLUGIN_TAG <string>] [--FIREHOSE_PLUGIN_BRANCH <string>]\
[--CLOUDWATCH_PLUGIN_CLONE_URL <string>] [--CLOUDWATCH_PLUGIN_TAG <string>] [--CLOUDWATCH_PLUGIN_BRANCH <string>] \
[--DOCKER_BUILD_FLAGS <string>]" 1>&2;
[--DOCKER_BUILD_FLAGS <string>] [--AL_TAG <string>]" 1>&2;
exit 1;
}

Expand Down Expand Up @@ -107,6 +109,12 @@ do
--DOCKER_BUILD_FLAGS)
if [ -n "$2" ];then PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS $2";fi
shift 2;;
--AL_TAG)
if [ -n "$2" ]; then
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg AL_TAG=$2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where/how is this eventually used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -AL_TAG override will be used when calling make-release/make-debug which currently assigns a default 2 in the makefile. For AL2023, we will override that default to AL2023 and it will flow down to all make targets and get passed into this script --AL_TAG=${AL_TAG} == --AL_TAG=2023.

I tried to cut-up the larger PR for all of the changes to make it easier to focus and not get lost in details

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. But why do the plugin builds need to be AL aware? We're doing go build for each of the Go plugins we bake in the image right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that is true, they do not need to be aware. We go build each plugin and then source that into the final image

AL_TAG=$2
fi
shift 2;;
# End of arguments. End here and break.
--) shift; break ;;
# Any other argument is an invalid arg.
Expand Down