From a8a30c82ad4d550b8bf6d62bd147b6481735a430 Mon Sep 17 00:00:00 2001 From: Jeff Cheng Date: Mon, 12 Apr 2021 12:34:19 -0400 Subject: [PATCH] Add msi target to Makefile --- .circleci/config.yml | 11 ++++------- Makefile | 8 ++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 71c0f1b38d..794602493c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -349,7 +349,7 @@ jobs: - run: name: Run docker image command: | - docker run -d -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=us0 --name otelcol otelcol:latest + docker run -d -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=fake-realm --name otelcol otelcol:latest sleep 10 if [ -z "$( docker ps --filter=status=running --filter=name=otelcol -q )" ]; then docker logs otelcol @@ -495,15 +495,12 @@ jobs: docker_layer_caching: true steps: - attach_to_workspace - - run: - name: Build msi-builder image - command: docker build -t msi-builder internal/buildscripts/packaging/msi/msi-builder - run: name: Build MSI command: | - mkdir dist - export VERSION_TAG="${CIRCLE_TAG/v/}" - docker run --rm -v $(pwd):/project -u 0 msi-builder "${VERSION_TAG:-0.0.1.$CIRCLE_BUILD_NUM}" + mkdir -p dist + export VERSION_TAG="${CIRCLE_TAG#v}" + make msi SKIP_COMPILE=true VERSION="${VERSION_TAG:-0.0.1.$CIRCLE_BUILD_NUM}" - persist_to_workspace: root: ~/ paths: project/dist/*.msi diff --git a/Makefile b/Makefile index 5e0bd00a72..5ba85695ce 100644 --- a/Makefile +++ b/Makefile @@ -224,3 +224,11 @@ ifneq ($(SKIP_COMPILE), true) endif docker build -t otelcol-fpm internal/buildscripts/packaging/fpm docker run --rm -v $(CURDIR):/repo -e PACKAGE=$* -e VERSION=$(VERSION) -e ARCH=$(ARCH) -e SMART_AGENT_RELEASE=$(SMART_AGENT_RELEASE) otelcol-fpm + +.PHONY: msi +msi: +ifneq ($(SKIP_COMPILE), true) + $(MAKE) binaries-windows_amd64 +endif + docker build -t msi-builder internal/buildscripts/packaging/msi/msi-builder + docker run --rm -v $(CURDIR):/project -u 0 msi-builder $(VERSION)