From 8844c2ab67fc508b28804f7668c3300dd1996328 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 6 Mar 2018 07:15:04 -0500 Subject: [PATCH] feat: pull herokuish from docker hub This removes the ability to support http proxy directly, but fixes issues where users may not be using exactly the same herokuish as we expect. Closes #2828 [ci skip] --- deb.mk | 28 +++++++++++++++------------- rpm.mk | 20 +++++++++++--------- rpm/herokuish.postinst | 14 -------------- 3 files changed, 26 insertions(+), 36 deletions(-) delete mode 100644 rpm/herokuish.postinst diff --git a/deb.mk b/deb.mk index 3fc74b6a7..85571586c 100644 --- a/deb.mk +++ b/deb.mk @@ -93,21 +93,23 @@ deb-herokuish: @echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install @echo "sleep 5" >> /tmp/tmp/post-install @echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install - @echo 'if [[ ! -z $${http_proxy+x} ]]; then BUILDARGS="--build-arg http_proxy=$$http_proxy"; fi' >> /tmp/tmp/post-install - @echo 'if [[ ! -z $${https_proxy+x} ]]; then BUILDARGS="$$BUILDARGS --build-arg https_proxy=$$https_proxy"; fi' >> /tmp/tmp/post-install - @echo 'if [[ ! -z $${BUILDARGS+x} ]]; then echo Adding proxy settings to docker build: $$BUILDARGS; fi' >> /tmp/tmp/post-install - @echo 'sudo docker build --pull $$BUILDARGS -t gliderlabs/herokuish /var/lib/herokuish' >> /tmp/tmp/post-install - - @echo "-> Cloning repository" - git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" --branch "v$(HEROKUISH_VERSION)" /tmp/tmp/herokuish > /dev/null - rm -rf /tmp/tmp/herokuish/.git /tmp/tmp/herokuish/.gitignore - - @echo "-> Copying files into place" - mkdir -p "/tmp/build/var/lib" - cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish + @echo 'if [[ ! -z $${http_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install + @echo 'if [[ ! -z $${https_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install + @echo 'if [[ ! -z $${BUILDARGS+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install + @echo "sudo docker pull gliderlabs/herokuish:v${HEROKUISH_VERSION} && sudo docker tag gliderlabs/herokuish:v${HEROKUISH_VERSION} gliderlabs/herokuish:latest" >> /tmp/tmp/post-install @echo "-> Creating $(HEROKUISH_PACKAGE_NAME)" - sudo fpm -t deb -s dir -C /tmp/build -n herokuish -v $(HEROKUISH_VERSION) -a $(HEROKUISH_ARCHITECTURE) -p $(HEROKUISH_PACKAGE_NAME) --deb-pre-depends 'docker-engine-cs (>= 1.9.1) | docker-engine (>= 1.9.1) | docker-ce | docker-ee' --deb-pre-depends sudo --after-install /tmp/tmp/post-install --url "https://github.com/$(HEROKUISH_REPO_NAME)" --description $(HEROKUISH_DESCRIPTION) --license 'MIT License' . + sudo fpm -t deb -s dir -C /tmp/build -n herokuish \ + -v $(HEROKUISH_VERSION) \ + -a $(HEROKUISH_ARCHITECTURE) \ + -p $(HEROKUISH_PACKAGE_NAME) \ + --deb-pre-depends 'docker-engine-cs (>= 1.9.1) | docker-engine (>= 1.9.1) | docker-ce | docker-ee' \ + --deb-pre-depends sudo \ + --after-install /tmp/tmp/post-install \ + --url "https://github.com/$(HEROKUISH_REPO_NAME)" \ + --description $(HEROKUISH_DESCRIPTION) \ + --license 'MIT License' \ + . mv *.deb /tmp deb-dokku: diff --git a/rpm.mk b/rpm.mk index 4226c0d59..ce819f239 100644 --- a/rpm.mk +++ b/rpm.mk @@ -22,14 +22,16 @@ rpm-herokuish: rm -rf /tmp/tmp /tmp/build $(HEROKUISH_RPM_PACKAGE_NAME) mkdir -p /tmp/tmp /tmp/build - @echo "-> Cloning repository" - git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" \ - --branch "v$(HEROKUISH_VERSION)" /tmp/tmp/herokuish > /dev/null - rm -rf /tmp/tmp/herokuish/.git /tmp/tmp/herokuish/.gitignore - - @echo "-> Copying files into place" - mkdir -p "/tmp/build/var/lib" - cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish + @echo "-> Creating rpm files" + @echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install + @echo 'echo "Starting docker"' >> /tmp/tmp/post-install + @echo 'systemctl start docker' >> /tmp/tmp/post-install + @echo "sleep 5" >> /tmp/tmp/post-install + @echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install + @echo 'if [[ ! -z $${http_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install + @echo 'if [[ ! -z $${https_proxy+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install + @echo 'if [[ ! -z $${BUILDARGS+x} ]]; then echo "See the docker pull docs for proxy configuration"; fi' >> /tmp/tmp/post-install + @echo "sudo docker pull gliderlabs/herokuish:v${HEROKUISH_VERSION} && sudo docker tag gliderlabs/herokuish:v${HEROKUISH_VERSION} gliderlabs/herokuish:latest" >> /tmp/tmp/post-install @echo "-> Creating $(HEROKUISH_RPM_PACKAGE_NAME)" sudo fpm -t rpm -s dir -C /tmp/build -n herokuish \ @@ -38,7 +40,7 @@ rpm-herokuish: -p $(HEROKUISH_RPM_PACKAGE_NAME) \ --depends '/usr/bin/docker' \ --depends 'sudo' \ - --after-install rpm/herokuish.postinst \ + --after-install /tmp/tmp/post-install \ --url "https://github.com/$(HEROKUISH_REPO_NAME)" \ --description $(HEROKUISH_DESCRIPTION) \ --license 'MIT License' \ diff --git a/rpm/herokuish.postinst b/rpm/herokuish.postinst deleted file mode 100644 index 0ee29b900..000000000 --- a/rpm/herokuish.postinst +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -set +o posix # rpm uses /bin/sh that forces bash in posix mode - -main() { - echo 'Starting docker' - systemctl start docker - - sleep 5 - - echo 'Importing herokuish into docker (around 5 minutes)' - sudo docker build --pull -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null -} - -main