diff --git a/.github/workflows/check_changelog.yml b/.github/workflows/check_changelog.yml index 0d1139f..282bf46 100644 --- a/.github/workflows/check_changelog.yml +++ b/.github/workflows/check_changelog.yml @@ -1,13 +1,17 @@ name: Check Changelog on: - pull_request: - types: [opened, reopened, edited, synchronize] + pull_request: + types: [opened, reopened, edited, synchronize] + jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Check that CHANGELOG is touched - run: | - cat $GITHUB_EVENT_PATH | jq .pull_request.title | grep -i '\[\(\(changelog skip\)\|\(ci skip\)\)\]' || git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md + check-changelog: + runs-on: ubuntu-latest + if: | + !contains(github.event.pull_request.body, '[skip changelog]') && + !contains(github.event.pull_request.body, '[changelog skip]') && + !contains(github.event.pull_request.body, '[skip ci]') + steps: + - uses: actions/checkout@v1 + - name: Check that CHANGELOG is touched + run: git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b24fd59 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,37 @@ +# APT Buildpack Changelog + +## Unreleased + + +## 2021-03-10 + +- Output a helpful error message when no `Aptfile` is found ([#87](https://github.com/heroku/heroku-buildpack-apt/pull/87)). + +## 2021-01-15 + +- Fail the build if `apt-get` or `curl` errors ([#79](https://github.com/heroku/heroku-buildpack-apt/pull/79)). +- Only try to add custom repositories when some are defined in `Aptfile` ([#79](https://github.com/heroku/heroku-buildpack-apt/pull/79)). + +## 2019-10-17 + +- Flush the cache on stack change ([#58](https://github.com/heroku/heroku-buildpack-apt/pull/58)). + +## 2019-09-06 + +- Stop using `force-yes` with newer version of apt-get ([#51](https://github.com/heroku/heroku-buildpack-apt/pull/51)). + +## 2019-06-11 + +- Prevent APT using source lists from `/etc/apt/sources.list.d/` ([#46](https://github.com/heroku/heroku-buildpack-apt/pull/46)). + +## 2019-06-10 + +- Add support for comments in `Aptfile` ([#24](https://github.com/heroku/heroku-buildpack-apt/pull/24)). + +## 2017-09-13 + +- Add support for custom repositories ([#18](https://github.com/heroku/heroku-buildpack-apt/pull/18)). + +## 2016 and earlier + +See the [Git log](https://github.com/heroku/heroku-buildpack-apt/commits/40883f0cb8e8ddb2876ca8be5d25ade4ff9617b1). diff --git a/README.md b/README.md index 515a9ec..b1e201b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,13 @@ Added ability to also specify custom repositories through **:repo:** in `Aptfile This buildpack is not meant to be used on its own, and instead should be in used in combination with Heroku's [multiple buildpack support](https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app). -Include a list of apt package names to be installed in a file named `Aptfile` +Include a list of apt package names to be installed in a file named `Aptfile`. + +To find out what packages are available, see: + + +See the [Heroku Stacks](https://devcenter.heroku.com/articles/stack) documention for which +Ubuntu LTS version is used by each Heroku stack. ## Example @@ -29,25 +35,13 @@ heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt #### Aptfile # you can list packages - libpq-dev + libexample-dev + # or include links to specific .deb files - http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-precise-amd64.deb - # or add custom apt repos - :repo:deb http://cz.archive.ubuntu.com/ubuntu artful main universe - -#### Gemfile - - source "https://rubygems.org" - gem "pg" - -### Check out the PG library version - - $ heroku run bash -a apt-pg-test - ~ $ irb - irb(main):001:0> require "pg" - => true - irb(main):002:0> PG::version_string - => "PG 0.15.1" + https://downloads.example.com/example.deb + + # or add custom apt repos (only required if using packages outside of the standard Ubuntu APT repositories) + :repo:deb https://apt.example.com/ example-distro main ## License diff --git a/bin/compile b/bin/compile index 577380d..8fe78e5 100755 --- a/bin/compile +++ b/bin/compile @@ -2,7 +2,7 @@ # bin/compile # fail fast -set -e +set -eo pipefail # debug # set -x @@ -67,8 +67,10 @@ else cat "/etc/apt/sources.list" > "$APT_SOURCES" # no cp here # add custom repositories from Aptfile to sources.list # like>> :repo:deb http://cz.archive.ubuntu.com/ubuntu artful main universe - topic "Adding custom repositories" - cat $BUILD_DIR/Aptfile | grep -s -e "^:repo:" | sed 's/^:repo:\(.*\)\s*$/\1/g' >> $APT_SOURCES + if grep -q -e "^:repo:" $BUILD_DIR/Aptfile; then + topic "Adding custom repositories" + cat $BUILD_DIR/Aptfile | grep -s -e "^:repo:" | sed 's/^:repo:\(.*\)\s*$/\1/g' >> $APT_SOURCES + fi fi APT_OPTIONS="-o debug::nolocking=true -o dir::cache=$APT_CACHE_DIR -o dir::state=$APT_STATE_DIR" @@ -85,7 +87,7 @@ for PACKAGE in $(cat $BUILD_DIR/Aptfile | grep -v -s -e '^#' | grep -v -s -e "^: PACKAGE_FILE=$APT_CACHE_DIR/archives/$PACKAGE_NAME.deb topic "Fetching $PACKAGE" - curl -s -L -z $PACKAGE_FILE -o $PACKAGE_FILE $PACKAGE 2>&1 | indent + curl --silent --show-error --fail -L -z $PACKAGE_FILE -o $PACKAGE_FILE $PACKAGE 2>&1 | indent else topic "Fetching .debs for $PACKAGE" apt-get $APT_OPTIONS -y $APT_FORCE_YES -d install --reinstall $PACKAGE | indent diff --git a/bin/detect b/bin/detect index c5e4eb4..6d92e28 100755 --- a/bin/detect +++ b/bin/detect @@ -2,7 +2,9 @@ # bin/detect if [ -f $1/Aptfile ]; then - echo "Apt" && exit 0 + echo "Apt" + exit 0 else - echo "no" && exit 1 + echo "Could not find an 'Aptfile'! Please ensure it exists and is checked into Git." >&2 + exit 1 fi