Skip to content

Commit

Permalink
Merge pull request #2 from heroku/master
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
jhottenstein authored Jun 18, 2021
2 parents 73e9358 + 0a77893 commit 08ea3b5
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 34 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
<https://packages.ubuntu.com>

See the [Heroku Stacks](https://devcenter.heroku.com/articles/stack) documention for which
Ubuntu LTS version is used by each Heroku stack.

## Example

Expand All @@ -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

Expand Down
10 changes: 6 additions & 4 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# bin/compile <build-dir> <cache-dir>

# fail fast
set -e
set -eo pipefail

# debug
# set -x
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions bin/detect
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# bin/detect <build-dir>

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

0 comments on commit 08ea3b5

Please sign in to comment.