diff --git a/.editorconfig b/.editorconfig index 8439b05fe..05e406bc4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,11 +7,9 @@ end_of_line = lf insert_final_newline = true charset = utf-8 trim_trailing_whitespace = true +indent_style = space +indent_size = 2 [*.go] indent_style = tab indent_size = 4 - -[contrib/post-install] -indent_size = 2 -indent_style = space diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e887d30e5..cc03b2a45 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: - name: Clone uses: actions/checkout@v5 - name: Run hadolint - uses: hadolint/hadolint-action@3fc49fb50d59c6ab7917a2e4195dba633e515b29 + uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 with: config: .github/linters/.hadolint.yml diff --git a/.gitignore b/.gitignore index eff4fa885..15aef64c8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ build include/cedarish.txt include/buildpacks.txt bindata.go +.idea/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 099ae3320..826a1ec3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,46 @@ All notable changes to this project will be documented in this file. +## [0.11.5](https://github.com/gliderlabs/herokuish/compare/v0.11.4...v0.11.5) - 2025-10-12 + +- #1608 @dokku-bot: Update nodejs to version v310 +- #1609 @dependabot: chore(deps): bump puma from 7.0.2 to 7.0.3 in /buildpacks/buildpack-ruby/tests/ruby-sinatra +- #1610 @dokku-bot: Update gradle to version v46 +- #1611 @dokku-bot: Update gradle to version v47 +- #1612 @dokku-bot: Update go to version v213 +- #1613 @dokku-bot: Update ruby to version v321 +- #1614 @dokku-bot: Update gradle to version v48 +- #1615 @dokku-bot: Update python to version v308 +- #1616 @dokku-bot: Update python to version v309 +- #1617 @dokku-bot: Update php to version v274 +- #1618 @dependabot: chore(deps-dev): bump heroku/heroku-buildpack-php from 273 to 274 in /buildpacks/buildpack-php/tests/php +- #1619 @dependabot: chore(deps): bump hadolint/hadolint-action from 3.2.0 to 3.3.0 +- #1620 @dokku-bot: Update python to version v310 +- #1621 @dependabot: chore(deps): bump puma from 7.0.3 to 7.0.4 in /buildpacks/buildpack-ruby/tests/ruby-sinatra +- #1622 @Tashows Expose buildpack detection as a command +- #1624 @dokku-bot: Update nodejs to version v313 +- #1625 @dependabot: chore(deps): bump markupsafe from 3.0.2 to 3.0.3 in /buildpacks/buildpack-python/tests/python-flask +- #1626 @dependabot: chore(deps): bump markupsafe from 3.0.2 to 3.0.3 in /buildpacks/buildpack-multi/tests/multi +- #1627 @dokku-bot: Update ruby to version v322 +- #1628 @dokku-bot: Update scala to version v100 +- #1629 @dependabot: chore(deps-dev): bump heroku/heroku-buildpack-php from 274 to 275 in /buildpacks/buildpack-php/tests/php +- #1630 @dokku-bot: Update python to version v311 +- #1631 @dokku-bot: Update php to version v275 +- #1632 @josegonzalez fix: use updated method of setting environment variables in Dockerfile +- #1633 @dependabot: chore(deps-dev): bump heroku/heroku-buildpack-php from 275 to 276 in /buildpacks/buildpack-php/tests/php +- #1634 @dokku-bot: Update python to version v312 +- #1635 @dokku-bot: Update php to version v276 +- #1636 @dependabot: chore(deps): bump rack from 3.2.1 to 3.2.2 in /buildpacks/buildpack-multi/tests/multi +- #1637 @dependabot: chore(deps): bump rack from 3.2.1 to 3.2.2 in /buildpacks/buildpack-ruby/tests/ruby-sinatra +- #1638 @dependabot: chore(deps): bump sinatra from 4.1.1 to 4.2.0 in /buildpacks/buildpack-ruby/tests/ruby-sinatra +- #1639 @dependabot: chore(deps): bump sinatra from 4.1.1 to 4.2.0 in /buildpacks/buildpack-multi/tests/multi +- #1640 @dokku-bot: Update go to version v214 +- #1642 @dependabot: chore(deps): bump rack from 3.2.2 to 3.2.3 in /buildpacks/buildpack-multi/tests/multi +- #1643 @dependabot: chore(deps): bump rack from 3.2.2 to 3.2.3 in /buildpacks/buildpack-ruby/tests/ruby-sinatra +- #1644 @dokku-bot: Update ruby to version v324 +- #1645 @dokku-bot: Update python to version v313 +- #1646 @dokku-bot: Update nodejs to version v314 + ## [0.11.4](https://github.com/gliderlabs/herokuish/compare/v0.11.3...v0.11.4) - 2025-09-12 - #1600 @dokku-bot: Update python to version v307 diff --git a/Dockerfile b/Dockerfile index 189cb4420..83e6719fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ ARG STACK_VERSION=24 ARG TARGETARCH ENV STACK=heroku-$STACK_VERSION -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive LABEL com.gliderlabs.herokuish/stack=$STACK USER root @@ -39,4 +39,4 @@ RUN apt-install daemontools && \ */tmp COPY include/default_user.bash /tmp/default_user.bash RUN bash /tmp/default_user.bash && rm -f /tmp/default_user.bash -ENV BASH_BIN /usr/bin/bash +ENV BASH_BIN=/usr/bin/bash diff --git a/Makefile b/Makefile index 4301e390c..613b4d998 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ REPOSITORY = herokuish DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku' HARDWARE = $(shell uname -m) SYSTEM_NAME = $(shell uname -s | tr '[:upper:]' '[:lower:]') -VERSION ?= 0.11.4 +VERSION ?= 0.11.5 IMAGE_NAME ?= $(NAME) BUILD_TAG ?= dev PACKAGECLOUD_REPOSITORY ?= dokku/dokku-betafish diff --git a/README.md b/README.md index ae057619f..ea2078825 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://github.com/gliderlabs/herokuish/workflows/CI/badge.svg)](https://github.com/gliderlabs/herokuish/actions?query=workflow%3ACI) [![IRC Channel](https://img.shields.io/badge/irc-%23gliderlabs-blue.svg)](https://kiwiirc.com/client/irc.freenode.net/#gliderlabs) -[![Docker Hub](https://img.shields.io/badge/docker%20hub-v0.11.4-blue)](https://hub.docker.com/r/gliderlabs/herokuish) +[![Docker Hub](https://img.shields.io/badge/docker%20hub-v0.11.5-blue)](https://hub.docker.com/r/gliderlabs/herokuish) A command line tool for emulating Heroku build and runtime tasks in containers. @@ -19,7 +19,7 @@ Download and uncompress the latest binary tarball from [releases](https://github For example, you can do this directly in your Dockerfiles installing into `/bin` as one step: ```shell -RUN curl --location --silent https://github.com/gliderlabs/herokuish/releases/download/v0.11.4/herokuish_0.11.4_linux_x86_64.tgz \ +RUN curl --location --silent https://github.com/gliderlabs/herokuish/releases/download/v0.11.5/herokuish_0.11.5_linux_x86_64.tgz \ | tar -xzC /bin ``` @@ -35,6 +35,7 @@ $ herokuish Available commands: buildpack Use and install buildpacks build Build an application using installed buildpacks + detect Detect buildpack to use for an application install Install buildpack from Git URL and optional committish list List installed buildpacks test Build and run tests for an application using installed buildpacks diff --git a/buildpacks/buildpack-go/buildpack-version b/buildpacks/buildpack-go/buildpack-version index 03493f92b..8e1a11531 100644 --- a/buildpacks/buildpack-go/buildpack-version +++ b/buildpacks/buildpack-go/buildpack-version @@ -1 +1 @@ -v212 +v214 diff --git a/buildpacks/buildpack-gradle/buildpack-version b/buildpacks/buildpack-gradle/buildpack-version index 7f2ae6d85..d6a12ab0f 100644 --- a/buildpacks/buildpack-gradle/buildpack-version +++ b/buildpacks/buildpack-gradle/buildpack-version @@ -1 +1 @@ -v45 +v48 diff --git a/buildpacks/buildpack-multi/tests/multi/Gemfile.lock b/buildpacks/buildpack-multi/tests/multi/Gemfile.lock index bfc4c59c1..c5f87ac63 100644 --- a/buildpacks/buildpack-multi/tests/multi/Gemfile.lock +++ b/buildpacks/buildpack-multi/tests/multi/Gemfile.lock @@ -1,12 +1,12 @@ GEM remote: http://rubygems.org/ specs: - base64 (0.2.0) - logger (1.6.1) - mustermann (3.0.3) + base64 (0.3.0) + logger (1.7.0) + mustermann (3.0.4) ruby2_keywords (~> 0.0.1) - rack (3.2.1) - rack-protection (4.1.1) + rack (3.2.3) + rack-protection (4.2.1) base64 (>= 0.1.0) logger (>= 1.6.0) rack (>= 3.0.0, < 4) @@ -14,14 +14,14 @@ GEM base64 (>= 0.1.0) rack (>= 3.0.0) ruby2_keywords (0.0.5) - sinatra (4.1.1) + sinatra (4.2.1) logger (>= 1.6.0) mustermann (~> 3.0) rack (>= 3.0.0, < 4) - rack-protection (= 4.1.1) + rack-protection (= 4.2.1) rack-session (>= 2.0.0, < 3) tilt (~> 2.0) - tilt (2.4.0) + tilt (2.6.1) PLATFORMS ruby diff --git a/buildpacks/buildpack-multi/tests/multi/requirements.txt b/buildpacks/buildpack-multi/tests/multi/requirements.txt index 7466020ae..ea71acc19 100644 --- a/buildpacks/buildpack-multi/tests/multi/requirements.txt +++ b/buildpacks/buildpack-multi/tests/multi/requirements.txt @@ -1,4 +1,4 @@ Flask==3.1.2 Jinja2==3.1.6 gunicorn==23.0.0 -markupsafe==3.0.2 +markupsafe==3.0.3 diff --git a/buildpacks/buildpack-nodejs/buildpack-version b/buildpacks/buildpack-nodejs/buildpack-version index bfeff6f42..d045e5e98 100644 --- a/buildpacks/buildpack-nodejs/buildpack-version +++ b/buildpacks/buildpack-nodejs/buildpack-version @@ -1 +1 @@ -v309 +v314 diff --git a/buildpacks/buildpack-php/buildpack-version b/buildpacks/buildpack-php/buildpack-version index d01bc5f51..8974eb956 100644 --- a/buildpacks/buildpack-php/buildpack-version +++ b/buildpacks/buildpack-php/buildpack-version @@ -1 +1 @@ -v273 +v276 diff --git a/buildpacks/buildpack-php/tests/php/composer.lock b/buildpacks/buildpack-php/tests/php/composer.lock index 3329ef668..138db4aca 100644 --- a/buildpacks/buildpack-php/tests/php/composer.lock +++ b/buildpacks/buildpack-php/tests/php/composer.lock @@ -2082,16 +2082,16 @@ "packages-dev": [ { "name": "heroku/heroku-buildpack-php", - "version": "v273", + "version": "v276", "source": { "type": "git", "url": "https://github.com/heroku/heroku-buildpack-php.git", - "reference": "14c4249916732841977f4cf7bf1df3c806be040d" + "reference": "4f50c0fc9b8c2e28595df22e3511a5337f751098" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/14c4249916732841977f4cf7bf1df3c806be040d", - "reference": "14c4249916732841977f4cf7bf1df3c806be040d", + "url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/4f50c0fc9b8c2e28595df22e3511a5337f751098", + "reference": "4f50c0fc9b8c2e28595df22e3511a5337f751098", "shasum": "" }, "bin": [ @@ -2121,9 +2121,9 @@ ], "support": { "issues": "https://github.com/heroku/heroku-buildpack-php/issues", - "source": "https://github.com/heroku/heroku-buildpack-php/tree/v273" + "source": "https://github.com/heroku/heroku-buildpack-php/tree/v276" }, - "time": "2025-09-04T13:06:10+00:00" + "time": "2025-10-05T22:48:36+00:00" } ], "aliases": [], diff --git a/buildpacks/buildpack-python/buildpack-version b/buildpacks/buildpack-python/buildpack-version index 240a71b39..62abc8f03 100644 --- a/buildpacks/buildpack-python/buildpack-version +++ b/buildpacks/buildpack-python/buildpack-version @@ -1 +1 @@ -v307 +v313 diff --git a/buildpacks/buildpack-python/tests/python-flask/requirements.txt b/buildpacks/buildpack-python/tests/python-flask/requirements.txt index 7466020ae..ea71acc19 100644 --- a/buildpacks/buildpack-python/tests/python-flask/requirements.txt +++ b/buildpacks/buildpack-python/tests/python-flask/requirements.txt @@ -1,4 +1,4 @@ Flask==3.1.2 Jinja2==3.1.6 gunicorn==23.0.0 -markupsafe==3.0.2 +markupsafe==3.0.3 diff --git a/buildpacks/buildpack-ruby/buildpack-version b/buildpacks/buildpack-ruby/buildpack-version index 440779c66..bdc4b4bed 100644 --- a/buildpacks/buildpack-ruby/buildpack-version +++ b/buildpacks/buildpack-ruby/buildpack-version @@ -1 +1 @@ -v320 +v324 diff --git a/buildpacks/buildpack-ruby/tests/ruby-sinatra/Gemfile.lock b/buildpacks/buildpack-ruby/tests/ruby-sinatra/Gemfile.lock index fec503bbc..d1f4e36a8 100644 --- a/buildpacks/buildpack-ruby/tests/ruby-sinatra/Gemfile.lock +++ b/buildpacks/buildpack-ruby/tests/ruby-sinatra/Gemfile.lock @@ -1,16 +1,16 @@ GEM remote: http://rubygems.org/ specs: - base64 (0.2.0) - logger (1.6.1) - mustermann (3.0.3) + base64 (0.3.0) + logger (1.7.0) + mustermann (3.0.4) ruby2_keywords (~> 0.0.1) nio4r (2.7.4) power_assert (2.0.5) - puma (7.0.2) + puma (7.0.4) nio4r (~> 2.0) - rack (3.2.1) - rack-protection (4.1.1) + rack (3.2.3) + rack-protection (4.2.1) base64 (>= 0.1.0) logger (>= 1.6.0) rack (>= 3.0.0, < 4) @@ -23,16 +23,16 @@ GEM rack (>= 3) rake (13.3.0) ruby2_keywords (0.0.5) - sinatra (4.1.1) + sinatra (4.2.1) logger (>= 1.6.0) mustermann (~> 3.0) rack (>= 3.0.0, < 4) - rack-protection (= 4.1.1) + rack-protection (= 4.2.1) rack-session (>= 2.0.0, < 3) tilt (~> 2.0) test-unit (3.7.0) power_assert - tilt (2.4.0) + tilt (2.6.1) PLATFORMS ruby diff --git a/buildpacks/buildpack-scala/buildpack-version b/buildpacks/buildpack-scala/buildpack-version index 0b160185d..0cf81b50f 100644 --- a/buildpacks/buildpack-scala/buildpack-version +++ b/buildpacks/buildpack-scala/buildpack-version @@ -1 +1 @@ -v99 +v100 diff --git a/include/buildpack.bash b/include/buildpack.bash index 6368085f6..01e043845 100644 --- a/include/buildpack.bash +++ b/include/buildpack.bash @@ -70,6 +70,14 @@ _select-buildpack() { fi } +buildpack-detect() { + declare desc="Detect suitable buildpack for an application" + ensure-paths + [[ "$USER" ]] || randomize-unprivileged + buildpack-setup >/dev/null + _select-buildpack +} + buildpack-build() { declare desc="Build an application using installed buildpacks" ensure-paths diff --git a/include/herokuish.bash b/include/herokuish.bash index f8bc06bdd..4e19af7c7 100644 --- a/include/herokuish.bash +++ b/include/herokuish.bash @@ -133,6 +133,7 @@ main() { cmd-export buildpack-install cmd-export buildpack-list cmd-export buildpack-test + cmd-export buildpack-detect cmd-export-ns slug "Manage application slugs" cmd-export slug-import diff --git a/tests/functional/tests.sh b/tests/functional/tests.sh index a61b2a582..18413d4ac 100644 --- a/tests/functional/tests.sh +++ b/tests/functional/tests.sh @@ -48,3 +48,48 @@ T_generate-slug() { herokuish slug generate tar tzf /tmp/slug.tgz" } + +T_buildpack-detect-default() { + herokuish-test "buildpack-detect-default" " + set -e + unset BUILDPACK_URL + export buildpack_path=/tmp/buildpacks + export build_path=/tmp/app + export unprivileged_user=\$(whoami) + export unprivileged_group=\$(id -gn) + + rm -rf \$buildpack_path && mkdir -p \$buildpack_path + + mkdir -p \$buildpack_path/00_buildpack-ruby/bin + { + echo '#!/usr/bin/env bash' + echo 'echo Ruby' + echo 'exit 0' + } > \$buildpack_path/00_buildpack-ruby/bin/detect + chmod +x \$buildpack_path/00_buildpack-ruby/bin/detect + + herokuish buildpack detect | grep 'Ruby app detected' + " +} + +T_buildpack-detect-fail() { + herokuish-test "buildpack-detect-fail" " + set -e + unset BUILDPACK_URL + export buildpack_path=/tmp/buildpacks + export build_path=/tmp/app + export unprivileged_user=\$(whoami) + export unprivileged_group=\$(id -gn) + + rm -rf \$buildpack_path && mkdir -p \$buildpack_path + + mkdir -p \$buildpack_path/00_buildpack-fail/bin + { + echo '#!/usr/bin/env bash' + echo 'exit 1' + } > \$buildpack_path/00_buildpack-fail/bin/detect + chmod +x \$buildpack_path/00_buildpack-fail/bin/detect + + herokuish buildpack detect 2>&1 | grep 'Unable to select a buildpack' + " +}