From 88eed6bc5999532b2b2360364acaf6616ebecb95 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Mon, 20 Jun 2016 18:34:26 -0700 Subject: [PATCH] Makefile: Add release tarball target --- .gitignore | 1 + Makefile | 16 +++++++++++++++- scripts/release-files | 29 +++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100755 scripts/release-files diff --git a/.gitignore b/.gitignore index f664d73b..31bf8800 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ _testmain.go *.test *.prof +_output/ bin/ assets/ *.aci diff --git a/Makefile b/Makefile index 4795f7ee..ce90fe03 100644 --- a/Makefile +++ b/Makefile @@ -22,4 +22,18 @@ uninstall: rm $(BIN_DIR)/bootcfg rm $(BIN_DIR)/bootcmd -.PHONY: build test install +release: clean _output/coreos-baremetal-linux-amd64.tar.gz + +_output/coreos-baremetal-%-amd64/bootcfg: build + @mkdir -p $(dir $@) + ./scripts/release-files $(dir $@) + +_output/coreos-baremetal-%-amd64.tar.gz: _output/coreos-baremetal-%-amd64/bootcfg + tar zcvf $@ -C _output coreos-baremetal-$*-amd64 + +clean: + rm -rf _output + +.PHONY: build clean install test + +.SECONDARY: _output/coreos-baremetal-linux-amd64/bootcfg diff --git a/scripts/release-files b/scripts/release-files new file mode 100755 index 00000000..82399418 --- /dev/null +++ b/scripts/release-files @@ -0,0 +1,29 @@ +#!/bin/bash -e +# USAGE: ./release-files DEST + +DEST=$1 + +if [ -z "${DEST}" ]; then + echo "Usage: ${0} DEST" + exit 255 +fi + +SCRIPTS=$DEST/scripts +CONTRIB=$DEST/contrib + +# binaries +mkdir -p $DEST +cp bin/bootcfg $DEST/bootcfg +cp bin/bootcmd $DEST/bootcmd + +# scripts +mkdir -p $SCRIPTS/tls +cp scripts/get-coreos $SCRIPTS + +cp examples/etc/bootcfg/README.md $SCRIPTS/tls +cp examples/etc/bootcfg/cert-gen $SCRIPTS/tls +cp examples/etc/bootcfg/openssl.conf $SCRIPTS/tls + +# systemd +mkdir -p $CONTRIB/systemd +cp contrib/systemd/bootcfg.service $CONTRIB/systemd