diff --git a/helm-chart-collator/Dockerfile b/helm-chart-collator/Dockerfile index 79968e9..0ac04ac 100644 --- a/helm-chart-collator/Dockerfile +++ b/helm-chart-collator/Dockerfile @@ -21,9 +21,8 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* COPY playbooks /opt/playbooks -COPY config /opt/config -ARG CHARTS="/opt/config/charts.yaml" +ARG CHARTS="" RUN ansible-playbook -v /opt/playbooks/create_repository.yaml \ -i /opt/playbooks/inventory.yaml \ --extra-vars "CHARTS=$CHARTS" diff --git a/helm-chart-collator/Makefile b/helm-chart-collator/Makefile index 7858c21..b6626d8 100644 --- a/helm-chart-collator/Makefile +++ b/helm-chart-collator/Makefile @@ -18,13 +18,12 @@ PUSH_IMAGE ?= false IMAGE_ID ?= none COMMIT ?= $(shell git rev-parse HEAD) LABEL ?= org.airshipit.build=community -IMAGE_NAME ?= helm-chart-collator +IMAGE_NAME ?= collator DOCKER_REGISTRY ?= quay.io IMAGE_PREFIX ?= airshipit IMAGE_TAG ?= latest DISTRO ?= debian_stable -CHARTS ?= \"$(cat "config/charts.yaml")\" -IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG} +IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}-${DISTRO} SH_TO_CHECK := $(wildcard files/*.sh ) PROXY ?= http://proxy.foo.com:8000 NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local @@ -75,23 +74,31 @@ build_collator: mkdir -p $(BUILD_DIR) ifeq ($(IMAGE_ID), none) ifeq ($(USE_PROXY), true) - ./build-image-make.sh \ - config/charts.yaml \ - $(IMAGE_NAME) \ - $(IMAGE) \ - $(LABEL) \ - $(BUILD_DIR) \ - $(USE_PROXY) \ - $(PROXY) \ - $(NO_PROXY) + docker build . \ + --iidfile $(BUILD_DIR)/image_id \ + --tag $(IMAGE) \ + --label $(LABEL) \ + --label "org.opencontainers.image.revision=$(COMMIT)" \ + --label "org.opencontainers.image.created=\ + $(shell date --rfc-3339=seconds --utc)" \ + --label "org.opencontainers.image.title=$(IMAGE_NAME)" \ + --build-arg http_proxy=$(PROXY) \ + --build-arg https_proxy=$(PROXY) \ + --build-arg HTTP_PROXY=$(PROXY) \ + --build-arg HTTPS_PROXY=$(PROXY) \ + --build-arg no_proxy=$(NO_PROXY) \ + --build-arg NO_PROXY=$(NO_PROXY) \ + --build-arg GIT_COMMIT=$(COMMIT) else - ./build-image-make.sh \ - config/charts.yaml \ - $(IMAGE_NAME) \ - $(IMAGE) \ - $(LABEL) \ - $(BUILD_DIR) \ - $(USE_PROXY) + docker build . \ + --iidfile $(BUILD_DIR)/image_id \ + --tag $(IMAGE) \ + --label $(LABEL) \ + --label "org.opencontainers.image.revision=$(COMMIT)" \ + --label "org.opencontainers.image.created=\ + $(shell date --rfc-3339=seconds --utc)" \ + --label "org.opencontainers.image.title=$(IMAGE_NAME)" \ + --build-arg GIT_COMMIT=$(COMMIT) endif else echo $(IMAGE_ID) > $(BUILD_DIR)/image_id diff --git a/helm-chart-collator/build-image-make.sh b/helm-chart-collator/build-image-make.sh deleted file mode 100755 index fc02da4..0000000 --- a/helm-chart-collator/build-image-make.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -# set -xe - -if [[ $# < 5 ]]; then - echo "usage:" - echo " $0 \\\n" - echo " \\\n" - echo " \\\n" - echo " \\\n" - echo "