diff --git a/Makefile b/Makefile index c4981f7..bf9677a 100644 --- a/Makefile +++ b/Makefile @@ -103,21 +103,21 @@ tar-windows: build-windows ## Build the windows binary and package it in a .tar .PHONY: brew-darwin brew-darwin: build-darwin ## Build the OSX binary and package it for OSX brew install # brew script goes here - # cp -p $(BUILD_PATH)/$(build_binary) $(package_binary) - # homebrew-build/build-darwin.sh $(PACKAGE_PATH) $(package_binary) $(CONTROLLER_BASE_URL) $(VERSION) - # rm -f $(package_binary) + cp -p $(BUILD_PATH)/$(build_binary) $(package_binary) + homebrew-build/build-darwin.sh $(PACKAGE_PATH) $(package_binary) $(CONTROLLER_BASE_URL) $(VERSION) + rm -f $(package_binary) .PHONY: deb-linux deb-linux: build-linux ## Build the linux binary and package it as a .deb for Debian apt-get install # deb script goes here - # cp -p $(BUILD_PATH)/$(build_binary) $(package_binary) - # deb-build/build-deb.sh $(package_binary) $(DOCKER_IMAGE_DEB) $(PACKAGE_PATH) $(CONTROLLER_BASE_URL) $(VERSION) - # rm -f $(package_binary) + cp -p $(BUILD_PATH)/$(build_binary) $(package_binary) + deb-build/build-deb.sh $(package_binary) $(DOCKER_IMAGE_DEB) $(PACKAGE_PATH) $(CONTROLLER_BASE_URL) $(VERSION) + rm -f $(package_binary) .PHONY: rpm-linux rpm-linux: build-linux ## Build the linux binary and package it as a .rpm for RedHat yum install # rpm script goes here - # cp -p $(BUILD_PATH)/$(build_binary) $(package_binary) - # rpm-build/build-rpm.sh $(package_binary) $(DOCKER_IMAGE_RPM) $(PACKAGE_PATH) $(CONTROLLER_BASE_URL) $(VERSION) - # rm -f $(package_binary) + cp -p $(BUILD_PATH)/$(build_binary) $(package_binary) + rpm-build/build-rpm.sh $(package_binary) $(DOCKER_IMAGE_RPM) $(PACKAGE_PATH) $(CONTROLLER_BASE_URL) $(VERSION) + rm -f $(package_binary) .PHONY: deploy deploy: ## Publishes the formula diff --git a/deb-build/build-deb.sh b/deb-build/build-deb.sh new file mode 100644 index 0000000..50c0229 --- /dev/null +++ b/deb-build/build-deb.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +cd $(dirname "$0") +cp ../$1 ./$1.static +tar -cvf appsody-deb.tar ./debian +docker run -it -v $PWD:/input -v $PWD:/output -e CMD_NAME=$1 \ + -e VERSION=$5 -e CONTROLLER_BASE_URL=$4 $2 +mv *.deb $3/ +rm $1.static +rm *.tar +cd - \ No newline at end of file diff --git a/deb-build/debian/appsody.install b/deb-build/debian/appsody.install deleted file mode 100644 index 6ff0095..0000000 --- a/deb-build/debian/appsody.install +++ /dev/null @@ -1 +0,0 @@ -./tree/* ./usr/bin diff --git a/deb-build/debian/appsody.postinst b/deb-build/debian/appsody.postinst deleted file mode 100644 index 830e475..0000000 --- a/deb-build/debian/appsody.postinst +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# postinst script for appsody -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see https://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - configure) - mv /usr/bin/PACKAGE_NAME.static /usr/bin/PACKAGE_NAME - mv /usr/bin/PACKAGE_NAME-controller.static /usr/bin/PACKAGE_NAME-controller - echo "Checking prerequisites..." - if [[ `docker ps 2> /dev/null` ]]; then - echo "Done." - else - echo "[Warning] Docker not detected. Please ensure docker is installed and running before using appsody." - fi - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 diff --git a/deb-build/debian/appsody.postrm b/deb-build/debian/appsody.postrm deleted file mode 100644 index a2523ff..0000000 --- a/deb-build/debian/appsody.postrm +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# postrm script for appsody -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see https://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - rm /usr/bin/PACKAGE_NAME - rm /usr/bin/PACKAGE_NAME-controller - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 diff --git a/deb-build/debian/appsody.substvars b/deb-build/debian/appsody.substvars deleted file mode 100644 index 978fc8b..0000000 --- a/deb-build/debian/appsody.substvars +++ /dev/null @@ -1,2 +0,0 @@ -misc:Depends= -misc:Pre-Depends= diff --git a/deb-build/debian/changelog b/deb-build/debian/changelog deleted file mode 100644 index 9054a47..0000000 --- a/deb-build/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -appsody (VERSION_NUMBER) unstable; urgency=medium - - * Initial release - - -- Appsody Wed, 08 May 2019 16:23:19 +0000 diff --git a/deb-build/debian/compat b/deb-build/debian/compat deleted file mode 100644 index f599e28..0000000 --- a/deb-build/debian/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/rpm-build/build-rpm.sh b/rpm-build/build-rpm.sh new file mode 100644 index 0000000..0245b57 --- /dev/null +++ b/rpm-build/build-rpm.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e +VERSION=$5 +cd $(dirname "$0") +cp ../$1 . +cp rpm-appsody.spec.tpl rpm-$1.spec +if [[ "$OSTYPE" == "darwin"* ]]; then + echo "FOR LOCAL DEBUG ONLY..." + sed -i "" "s/PACKAGE_NAME/$1/g" rpm-$1.spec + sed -i "" "s/PACKAGE_VERSION/$VERSION/g" rpm-$1.spec + sed -i "" "s+CONTROLLER_BASE_URL+$4+g" rpm-$1.spec +else + echo "Travis only..." + sed -i "s/PACKAGE_NAME/$1/g" rpm-$1.spec + sed -i "s/PACKAGE_VERSION/$VERSION/g" rpm-$1.spec + sed -i "s+CONTROLLER_BASE_URL+$4+g" rpm-$1.spec +fi +docker run -v $PWD:/sources -v $PWD:/output:Z $2:centos-7 +# Get rid of the source RPM package +rm -f $1*.src.rpm +mv $1*.rpm $3/ +rm -f $1 rpm-$1.spec +cd - \ No newline at end of file