Compare commits
No commits in common. "442bd15ae8825c372574f8f4aa82816be03d20d8" and "09dc31cc2255cf1af00d7010658f73b200159cb5" have entirely different histories.
442bd15ae8
...
09dc31cc22
@ -1,13 +1,3 @@
|
|||||||
SHELL := bash
|
|
||||||
.SHELLFLAGS := -eu -o pipefail -c
|
|
||||||
.DELETE_ON_ERROR:
|
|
||||||
.SILENT: ; # no need for @
|
|
||||||
.ONESHELL: ; # recipes execute in same shell
|
|
||||||
.NOTPARALLEL: ; # wait for this target to finish
|
|
||||||
.EXPORT_ALL_VARIABLES: ; # send all vars to shell
|
|
||||||
.PHONY: all # All targets are accessible for user
|
|
||||||
.DEFAULT: help # Running Make will run the help target
|
|
||||||
|
|
||||||
# Parse version from latest git semver tag
|
# Parse version from latest git semver tag
|
||||||
GIT_TAG ?= $(shell git describe --tags --match v*.*.* 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)
|
GIT_TAG ?= $(shell git describe --tags --match v*.*.* 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)
|
||||||
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
||||||
@ -33,6 +23,13 @@ ifneq ($(TRIVY_REMOTE),)
|
|||||||
TRIVY_OPTS ::= --server $(TRIVY_REMOTE)
|
TRIVY_OPTS ::= --server $(TRIVY_REMOTE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
.SILENT: ; # no need for @
|
||||||
|
.ONESHELL: ; # recipes execute in same shell
|
||||||
|
.NOTPARALLEL: ; # wait for this target to finish
|
||||||
|
.EXPORT_ALL_VARIABLES: ; # send all vars to shell
|
||||||
|
.PHONY: all # All targets are accessible for user
|
||||||
|
.DEFAULT: help # Running Make will run the help target
|
||||||
|
|
||||||
help: ## Show Help
|
help: ## Show Help
|
||||||
grep -E '^[a-zA-Z_-]+:.*?## .*$$' .ci/podman.mk | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
grep -E '^[a-zA-Z_-]+:.*?## .*$$' .ci/podman.mk | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
@ -43,28 +40,27 @@ fmt:: ## auto format source
|
|||||||
lint:: ## Lint source
|
lint:: ## Lint source
|
||||||
|
|
||||||
build: ## Build the app
|
build: ## Build the app
|
||||||
podman build --rm --layers -t $(IMAGE):$(TAG)-$(_ARCH) --build-arg TAG=$(TAG) --build-arg ARCH=$(_ARCH) --platform linux/$(_ARCH) .
|
buildah build --rm --layers -t $(IMAGE):$(TAG)-$(_ARCH) --build-arg TAG=$(TAG) --build-arg ARCH=$(_ARCH) --platform linux/$(_ARCH) .
|
||||||
|
|
||||||
test:: ## test built artificats
|
test:: ## test built artificats
|
||||||
|
|
||||||
scan: ## Scan image using trivy
|
scan: ## Scan image using trivy
|
||||||
echo "Scanning $(IMAGE):$(TAG)-$(_ARCH) using Trivy $(TRIVY_REMOTE)"
|
echo "Scanning $(IMAGE):$(TAG)-$(_ARCH) using Trivy $(TRIVY_REMOTE)"
|
||||||
trivy image $(TRIVY_OPTS) --quiet --no-progress --ignorefile ./.trivyignore.yaml localhost/$(IMAGE):$(TAG)-$(_ARCH)
|
trivy image $(TRIVY_OPTS) --quiet --no-progress localhost/$(IMAGE):$(TAG)-$(_ARCH)
|
||||||
|
|
||||||
# first tag and push all actual images
|
# first tag and push all actual images
|
||||||
# create new manifest for each tag and add all available TAG-ARCH before pushing
|
# create new manifest for each tag and add all available TAG-ARCH before pushing
|
||||||
push: ecr-login ## push images to registry
|
push: ecr-login ## push images to registry
|
||||||
for t in $(TAG) latest $(EXTRA_TAGS); do
|
for t in $(TAG) latest $(EXTRA_TAGS); do \
|
||||||
echo "Tagging image with $(REGISTRY)/$(IMAGE):$${t}-$(ARCH)"
|
echo "Tagging image with $(REGISTRY)/$(IMAGE):$${t}-$(ARCH)"
|
||||||
podman tag $(IMAGE):$(TAG)-$(_ARCH) $(REGISTRY)/$(IMAGE):$${t}-$(_ARCH)
|
buildah tag $(IMAGE):$(TAG)-$(_ARCH) $(REGISTRY)/$(IMAGE):$${t}-$(_ARCH); \
|
||||||
podman manifest rm $(IMAGE):$$t || true
|
buildah manifest rm $(IMAGE):$$t || true; \
|
||||||
podman manifest create $(IMAGE):$$t
|
buildah manifest create $(IMAGE):$$t; \
|
||||||
for a in $(ALL_ARCHS); do
|
for a in $(ALL_ARCHS); do \
|
||||||
podman image exists $(REGISTRY)/$(IMAGE):$$t-$$a && \
|
buildah manifest add $(IMAGE):$$t $(REGISTRY)/$(IMAGE):$(TAG)-$$a; \
|
||||||
podman manifest add $(IMAGE):$$t containers-storage:$(REGISTRY)/$(IMAGE):$$t-$$a
|
done; \
|
||||||
done
|
|
||||||
echo "Pushing manifest $(IMAGE):$$t"
|
echo "Pushing manifest $(IMAGE):$$t"
|
||||||
podman manifest push --all $(IMAGE):$$t docker://$(REGISTRY)/$(IMAGE):$$t
|
buildah manifest push --all $(IMAGE):$$t docker://$(REGISTRY)/$(IMAGE):$$t; \
|
||||||
done
|
done
|
||||||
|
|
||||||
ecr-login: ## log into AWS ECR public
|
ecr-login: ## log into AWS ECR public
|
||||||
@ -77,15 +73,12 @@ rm-remote-untagged: ## delete all remote untagged and in-dev images, keep 10 tag
|
|||||||
clean:: ## clean up source folder
|
clean:: ## clean up source folder
|
||||||
|
|
||||||
rm-image:
|
rm-image:
|
||||||
for t in $(TAG) latest $(EXTRA_TAGS); do
|
test -z "$$(podman image ls -q $(IMAGE):$(TAG)-$(_ARCH))" || podman image rm -f $(IMAGE):$(TAG)-$(_ARCH) > /dev/null
|
||||||
for a in $(ALL_ARCHS); do
|
test -z "$$(podman image ls -q $(IMAGE):$(TAG)-$(_ARCH))" || echo "Error: Removing image failed"
|
||||||
podman image exists $(IMAGE):$$t-$$a && podman image rm -f $(IMAGE):$$t-$$a || true
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
## some useful tasks during development
|
## some useful tasks during development
|
||||||
ci-pull-upstream: ## pull latest shared .ci subtree
|
ci-pull-upstream: ## pull latest shared .ci subtree
|
||||||
git subtree pull --prefix .ci ssh://git@git.zero-downtime.net/ZeroDownTime/ci-tools-lib.git main --squash -m "Merge latest ci-tools-lib"
|
git subtree pull --prefix .ci ssh://git@git.zero-downtime.net/ZeroDownTime/ci-tools-lib.git master --squash -m "Merge latest ci-tools-lib"
|
||||||
|
|
||||||
create-repo: ## create new AWS ECR public repository
|
create-repo: ## create new AWS ECR public repository
|
||||||
aws ecr-public create-repository --repository-name $(IMAGE) --region $(REGION)
|
aws ecr-public create-repository --repository-name $(IMAGE) --region $(REGION)
|
||||||
|
@ -12,7 +12,6 @@ ENV FLUENTD_DISABLE_BUNDLER_INJECTION 1
|
|||||||
RUN apk update \
|
RUN apk update \
|
||||||
&& apk add --no-cache \
|
&& apk add --no-cache \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
libcurl \
|
|
||||||
ruby ruby-irb ruby-etc ruby-webrick \
|
ruby ruby-irb ruby-etc ruby-webrick \
|
||||||
tini ruby-bundler \
|
tini ruby-bundler \
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
&& apk add --no-cache --virtual .build-deps \
|
||||||
@ -32,6 +31,7 @@ RUN addgroup -S fluent && adduser -S -g fluent fluent \
|
|||||||
&& mkdir -p /fluentd/etc /fluentd/plugins \
|
&& mkdir -p /fluentd/etc /fluentd/plugins \
|
||||||
&& chown -R fluent /fluentd && chgrp -R fluent /fluentd
|
&& chown -R fluent /fluentd && chgrp -R fluent /fluentd
|
||||||
|
|
||||||
|
|
||||||
COPY fluent.conf /fluentd/etc/
|
COPY fluent.conf /fluentd/etc/
|
||||||
COPY entrypoint.sh /bin/
|
COPY entrypoint.sh /bin/
|
||||||
|
|
||||||
|
1
Gemfile
1
Gemfile
@ -7,7 +7,6 @@ gem "ffi"
|
|||||||
gem "fluentd", "1.16.5"
|
gem "fluentd", "1.16.5"
|
||||||
gem "oj", "~> 3.16.0"
|
gem "oj", "~> 3.16.0"
|
||||||
gem "rexml", "~> 3.2.5"
|
gem "rexml", "~> 3.2.5"
|
||||||
gem "faraday-typhoeus", "~> 1.1.0"
|
|
||||||
gem "fluent-plugin-multi-format-parser", "~> 1.1.0"
|
gem "fluent-plugin-multi-format-parser", "~> 1.1.0"
|
||||||
gem "fluent-plugin-concat", "~> 2.5.0"
|
gem "fluent-plugin-concat", "~> 2.5.0"
|
||||||
gem "fluent-plugin-grok-parser", "~> 2.6.2"
|
gem "fluent-plugin-grok-parser", "~> 2.6.2"
|
||||||
|
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -1,4 +1,4 @@
|
|||||||
library identifier: 'zdt-lib@main', retriever: modernSCM(
|
library identifier: 'zdt-lib@master', retriever: modernSCM(
|
||||||
[$class: 'GitSCMSource',
|
[$class: 'GitSCMSource',
|
||||||
remote: 'https://git.zero-downtime.net/ZeroDownTime/ci-tools-lib.git'])
|
remote: 'https://git.zero-downtime.net/ZeroDownTime/ci-tools-lib.git'])
|
||||||
|
|
||||||
|
@ -9,6 +9,5 @@ Opinionated Fluentd container intended to work as central ingestion service fron
|
|||||||
- fluentd runs as non-root fluent user
|
- fluentd runs as non-root fluent user
|
||||||
|
|
||||||
# Resources
|
# Resources
|
||||||
- https://github.com/fluent/fluent-plugin-opensearch
|
|
||||||
- https://github.com/fluent/fluentd-docker-image/blob/master/v1.14/alpine/Dockerfile
|
- https://github.com/fluent/fluentd-docker-image/blob/master/v1.14/alpine/Dockerfile
|
||||||
- https://github.com/fluent/fluentd-kubernetes-daemonset/tree/master/docker-image/v1.16/debian-elasticsearch7
|
- https://github.com/fluent/fluentd-kubernetes-daemonset/tree/master/docker-image/v1.16/debian-elasticsearch7
|
||||||
|
Loading…
Reference in New Issue
Block a user