Skip to content

Commit c56b045

Browse files
authored
Merge pull request #1176 from gliderlabs/master
Release 0.8.0
2 parents 6291a27 + 1e44d15 commit c56b045

File tree

36 files changed

+989
-809
lines changed

36 files changed

+989
-809
lines changed

.github/linters/.hadolint.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ignored:
2+
- DL3048
3+
- DL3005
4+
- DL3008
5+
- DL3003
6+
- SC2035

.github/linters/.markdown-lint.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
default: true
3+
4+
# Line length
5+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md013
6+
MD013: false
7+
8+
# Inline HTML
9+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md033
10+
MD033: false
11+
12+
# List indentation
13+
# 2 spaces breaks list formatting in mkdocs
14+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md007
15+
MD007:
16+
indent: 4
17+
18+
# Fenced code blocks should have a language specified
19+
# We use a second, un-languaged code block to denote the output
20+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md040
21+
MD040: false
22+
23+
# Blank line inside blockquote
24+
# This is typically done when a section has a "New as of" or "Warning" in addition to a note
25+
# May wish to take advantage of github-style admonitions
26+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md028
27+
MD028: false
28+
29+
# No duplicate headers
30+
# HISTORY.md has a ton of these
31+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md024
32+
MD024: false
33+
34+
# First line h1
35+
# The issue template doesn't have one
36+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md041
37+
MD041: false

.github/linters/.yamllint.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
line-length: disable
6+
7+
ignore:
8+
- plugins/scheduler-k3s/templates/*

.github/workflows/lint.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
name: "lint"
3+
4+
# yamllint disable-line rule:truthy
5+
on:
6+
pull_request:
7+
branches:
8+
- "*"
9+
push:
10+
branches:
11+
- "master"
12+
13+
concurrency:
14+
group: lint-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
hadolint:
19+
name: hadolint
20+
runs-on: ubuntu-22.04
21+
steps:
22+
- name: Clone
23+
uses: actions/checkout@v4
24+
- name: Run hadolint
25+
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf
26+
with:
27+
config: .github/linters/.hadolint.yml
28+
29+
markdown-lint:
30+
name: markdown-lint
31+
runs-on: ubuntu-22.04
32+
steps:
33+
- name: Clone
34+
uses: actions/checkout@v4
35+
- name: Setup node
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: "20"
39+
cache: "npm"
40+
cache-dependency-path: ".github/workflows/lint.yml"
41+
- name: Install markdownlint-cli
42+
run: npm install -g [email protected]
43+
- name: Run markdown-lint
44+
run: markdownlint -c .github/linters/.markdown-lint.yml *.md **/*.md
45+
46+
shellcheck:
47+
name: shellcheck
48+
runs-on: ubuntu-22.04
49+
steps:
50+
- name: Clone
51+
uses: actions/checkout@v4
52+
- name: Run shellcheck
53+
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
54+
with:
55+
ignore_paths: >-
56+
./tests/unit/fixtures/.profile.d/app.sh
57+
58+
shfmt:
59+
name: shfmt
60+
runs-on: ubuntu-22.04
61+
steps:
62+
- name: Clone
63+
uses: actions/checkout@v4
64+
- name: Run shfmt
65+
uses: luizm/action-sh-checker@c6edb3de93e904488b413636d96c6a56e3ad671a
66+
env:
67+
SHFMT_OPTS: -l -bn -ci -i 2 -d
68+
with:
69+
sh_checker_shellcheck_disable: true
70+
71+
yamllint:
72+
name: yamllint
73+
runs-on: ubuntu-22.04
74+
steps:
75+
- name: Clone
76+
uses: actions/checkout@v4
77+
- name: Run yamllint
78+
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c
79+
with:
80+
config_file: ".github/linters/.yamllint.yml"

.github/workflows/main.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ jobs:
5151
- name: shellcheck
5252
run: make shellcheck
5353

54-
- name: lint
55-
run: make lint
56-
5754
- name: install requirements
5855
run: make deps fpm package_cloud
5956

@@ -87,7 +84,7 @@ jobs:
8784
fi
8885
8986
- name: upload packages
90-
uses: actions/upload-artifact@v3
87+
uses: actions/upload-artifact@v4
9188
with:
9289
name: build-${{ matrix.heroku }}-${{ matrix.buildx }}
9390
path: build
@@ -125,7 +122,7 @@ jobs:
125122
go-version: 1.17.8
126123

127124
- name: download packages
128-
uses: actions/download-artifact@v3
125+
uses: actions/download-artifact@v4
129126
with:
130127
name: build-${{ matrix.heroku }}-false
131128
path: build

.github/workflows/tag-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
make build build/docker/${{ matrix.heroku }} BUILDX=false STACK_VERSION=${{ matrix.heroku }}
5151
5252
- name: upload packages
53-
uses: actions/upload-artifact@v3
53+
uses: actions/upload-artifact@v4
5454
with:
5555
name: build-${{ matrix.heroku }}-${{ matrix.buildx }}
5656
path: build
@@ -68,7 +68,7 @@ jobs:
6868
ruby-version: 3.3
6969

7070
- name: download packages
71-
uses: actions/download-artifact@v3
71+
uses: actions/download-artifact@v4
7272
with:
7373
name: build-22-false
7474
path: build

.shellcheckrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
disable=SC2128
2+
disable=SC1091
3+
disable=SC2002
4+
disable=SC2294
5+
disable=SC2034
6+
disable=SC2031
7+
disable=SC2030

CHANGELOG.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.8.0](https://github.com/gliderlabs/herokuish/compare/v0.7.6...v0.8.0) - 2024-03-28
6+
7+
- #1093 @dependabot: chore(deps): bump actions/download-artifact from 3 to 4
8+
- #1173 @josegonzalez: Use find to identify only files not already owned by user
9+
- #1174 @josegonzalez: Add linting to CI
10+
- #1175 @josegonzalez: Ensure all file permissions are set to specified unprivileged user
11+
- #467 @mlandauer: Only copy from app import path to app path when building
12+
513
## [0.7.6](https://github.com/gliderlabs/herokuish/compare/v0.7.5...v0.7.6) - 2024-03-28
614

715
- #1171 @josegonzalez: Use a run mount to add build dependencies
@@ -877,7 +885,7 @@ All notable changes to this project will be documented in this file.
877885

878886
- @michaelshobbs remove erlang from buildpack bundle
879887

880-
**NOTE: v0.4.0 is now based on heroku-16**
888+
> NOTE: v0.4.0 is now based on heroku-16
881889
882890
## [0.3.36](https://github.com/gliderlabs/herokuish/compare/v0.3.35...v0.3.36) - 2018-03-10
883891

@@ -890,7 +898,7 @@ All notable changes to this project will be documented in this file.
890898
- @michaelshobbs Update nodejs to version v121
891899
- @michaelshobbs Update go to version v85
892900

893-
**NOTE: This will be the last version of herokuish based on cedar-14**
901+
> NOTE: This will be the last version of herokuish based on cedar-14
894902
895903
## [0.3.35](https://github.com/gliderlabs/herokuish/compare/v0.3.34...v0.3.35) - 2018-02-09
896904

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG STACK_VERSION=20
33

44
FROM golang:1.22 AS builder
55
RUN mkdir /src
6-
ADD . /src/
6+
COPY . /src/
77
WORKDIR /src
88

99
ARG VERSION
@@ -15,7 +15,7 @@ ARG TARGETARCH
1515

1616
ADD https://raw.githubusercontent.com/heroku/stack-images/main/heroku-${STACK_VERSION}/setup.sh /tmp/setup-01.sh
1717
ADD https://raw.githubusercontent.com/heroku/stack-images/main/heroku-${STACK_VERSION}-build/setup.sh /tmp/setup-02.sh
18-
ADD bin/setup.sh /tmp/setup.sh
18+
COPY bin/setup.sh /tmp/setup.sh
1919
RUN --mount=source=build-deps/${STACK_VERSION},target=/build STACK_VERSION=${STACK_VERSION} TARGETARCH=${TARGETARCH} /tmp/setup.sh && \
2020
rm -rf /tmp/setup.sh
2121

@@ -24,9 +24,9 @@ ENV DEBIAN_FRONTEND noninteractive
2424
LABEL com.gliderlabs.herokuish/stack=$STACK
2525

2626
RUN apt-get update -qq \
27-
&& apt-get install -qq -y daemontools \
27+
&& apt-get install --no-install-recommends -qq -y daemontools \
2828
&& cp /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml.custom \
29-
&& apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew \
29+
&& apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew \
3030
--allow-downgrades \
3131
--allow-remove-essential \
3232
--allow-change-held-packages \

Makefile

+1-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ REPOSITORY = herokuish
44
DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
55
HARDWARE = $(shell uname -m)
66
SYSTEM_NAME = $(shell uname -s | tr '[:upper:]' '[:lower:]')
7-
VERSION ?= 0.7.6
7+
VERSION ?= 0.8.0
88
IMAGE_NAME ?= $(NAME)
99
BUILD_TAG ?= dev
1010
PACKAGECLOUD_REPOSITORY ?= dokku/dokku-betafish
@@ -159,18 +159,6 @@ ci-report:
159159
ruby -v
160160
rm -f ~/.gitconfig
161161

162-
lint:
163-
# SC2002: Useless cat - https://github.com/koalaman/shellcheck/wiki/SC2002
164-
# SC2030: Modification of name is local - https://github.com/koalaman/shellcheck/wiki/SC2030
165-
# SC2031: Modification of name is local - https://github.com/koalaman/shellcheck/wiki/SC2031
166-
# SC2034: VAR appears unused - https://github.com/koalaman/shellcheck/wiki/SC2034
167-
# SC2206: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
168-
# SC2001: See if you can use ${variable//search/replace} instead.
169-
# SC2231: Quote expansions in this for loop glob to prevent wordsplitting, e.g. "$dir"/*.txt .
170-
# SC2230: which is non-standard. Use builtin 'command -v' instead.
171-
@echo linting...
172-
shellcheck -e SC2002,SC2030,SC2031,SC2034,SC2206,SC2001,SC2231,SC2230 -s bash include/*.bash tests/**/tests.sh
173-
174162
release: build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm build/deb/$(NAME)_$(VERSION)_all.deb bin/gh-release bin/gh-release-body
175163
ls -lah build build/* || true
176164
chmod +x build/linux/$(NAME) build/darwin/$(NAME)

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://github.com/gliderlabs/herokuish/workflows/CI/badge.svg)](https://github.com/gliderlabs/herokuish/actions?query=workflow%3ACI)
44
[![IRC Channel](https://img.shields.io/badge/irc-%23gliderlabs-blue.svg)](https://kiwiirc.com/client/irc.freenode.net/#gliderlabs)
5-
[![Docker Hub](https://img.shields.io/badge/docker%20hub-v0.7.6-blue)](https://hub.docker.com/r/gliderlabs/herokuish)
5+
[![Docker Hub](https://img.shields.io/badge/docker%20hub-v0.8.0-blue)](https://hub.docker.com/r/gliderlabs/herokuish)
66

77
A command line tool for emulating Heroku build and runtime tasks in containers.
88

@@ -19,7 +19,7 @@ Download and uncompress the latest binary tarball from [releases](https://github
1919
For example, you can do this directly in your Dockerfiles installing into `/bin` as one step:
2020

2121
```shell
22-
RUN curl --location --silent https://github.com/gliderlabs/herokuish/releases/download/v0.7.6/herokuish_0.7.6_linux_x86_64.tgz \
22+
RUN curl --location --silent https://github.com/gliderlabs/herokuish/releases/download/v0.8.0/herokuish_0.8.0_linux_x86_64.tgz \
2323
| tar -xzC /bin
2424
```
2525

@@ -60,7 +60,7 @@ For example, build processes that produce Docker images without producing interm
6060
`herokuish exec` will by default drop root privileges through use of [setuidgid](https://cr.yp.to/daemontools/setuidgid.html),
6161
but if already running as a non-root user setuidgid will fail, you can opt-out from this by setting the env-var `HEROKUISH_SETUIDGUID=false`.
6262

63-
#### Buildpacks
63+
### Buildpacks
6464

6565
Herokuish does not come with any buildpacks, but it is tested against recent versions of Heroku supported buildpacks. You can see this information with `herokuish version`. Example output:
6666

@@ -78,7 +78,7 @@ buildpacks:
7878

7979
You can install all supported buildpacks with `herokuish buildpack install`, or you can manually install buildpacks individually with `herokuish buildpack install <url> [committish]`. You can also mount a directory containing your platform's supported buildpacks (see Paths, next section), or you could bake your supported buildpacks into an image. These are the types of decisions that are up to you.
8080

81-
#### Paths
81+
### Paths
8282

8383
Use `herokuish paths` to see relevant system paths it uses. You can use these to import or mount data for use inside a container. They can also be overridden by setting the appropriate environment variable.
8484

@@ -93,11 +93,11 @@ BUILDPACK_PATH=/tmp/buildpacks # Path to installed buildpacks
9393

9494
```
9595

96-
#### Entrypoints
96+
### Entrypoints
9797

9898
Some subcommands are made to be used as default commands or entrypoint commands for containers. Specifically, herokuish detects if it was called as `/start`, `/exec`, or `/build` which will shortcut it to running those subcommands directly. This means you can either install the binary in those locations or create symlinks from those locations, allowing you to use them as your container entrypoint.
9999

100-
#### Help
100+
### Help
101101

102102
Don't be afraid of the help command. It actually tells you exactly what a command does:
103103

@@ -128,7 +128,7 @@ Having trouble pushing an app to Dokku or Heroku? Use Herokuish with a local Doc
128128
instance to debug. This is especially helpful with Dokku to help determine if it's a buildpack
129129
issue or an issue with Dokku. Buildpack issues should be filed against Herokuish.
130130

131-
#### Running an app against Herokuish
131+
### Running an app against Herokuish
132132

133133
```shell
134134
docker run --rm -v /abs/app/path:/tmp/app gliderlabs/herokuish /bin/herokuish test
@@ -147,7 +147,7 @@ Mounting your local app source directory to `/tmp/app` and running `/bin/herokui
147147

148148
You can use this output when you submit issues.
149149

150-
#### Running an app tests using Heroku buildpacks
150+
### Running an app tests using Heroku buildpacks
151151

152152
```shell
153153
docker run --rm -v /abs/app/path:/tmp/app gliderlabs/herokuish /bin/herokuish buildpack test
@@ -175,7 +175,7 @@ docker run --platform linux/amd64 --rm -v /abs/app/path:/tmp/app gliderlabs/hero
175175

176176
However, there is a risk of compatibility issues when running on a different platform than the one you are developing on. If you are getting strange compilation or segfaults, try running the build process on an x86 platform.
177177

178-
#### Troubleshooting
178+
## Troubleshooting
179179

180180
If you run into an issue and looking for more insight into what `herokuish` is doing, you can set the `$TRACE` environment variable.
181181

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
source "$(dirname $BASH_SOURCE)/../../../test"
2-
app-test "$(basename $(dirname $BASH_SOURCE))"
3-
buildpack-test "$(basename $(dirname $BASH_SOURCE))"
1+
# shellcheck shell=bash
2+
3+
source "$(dirname "$BASH_SOURCE")/../../../test"
4+
app-test "$(basename "$(dirname "$BASH_SOURCE")")"
5+
buildpack-test "$(basename "$(dirname "$BASH_SOURCE")")"
+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
source "$(dirname $BASH_SOURCE)/../../../test"
2-
app-test "$(basename $(dirname $BASH_SOURCE))"
1+
# shellcheck shell=bash
2+
3+
source "$(dirname "$BASH_SOURCE")/../../../test"
4+
app-test "$(basename "$(dirname "$BASH_SOURCE")")"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
source "$(dirname $BASH_SOURCE)/../../../test"
2-
app-test "$(basename $(dirname $BASH_SOURCE))"
1+
# shellcheck shell=bash
2+
3+
source "$(dirname "$BASH_SOURCE")/../../../test"
4+
app-test "$(basename "$(dirname "$BASH_SOURCE")")"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
source "$(dirname $BASH_SOURCE)/../../../test"
2-
app-test "$(basename $(dirname $BASH_SOURCE))"
1+
# shellcheck shell=bash
2+
3+
source "$(dirname "$BASH_SOURCE")/../../../test"
4+
app-test "$(basename "$(dirname "$BASH_SOURCE")")"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
source "$(dirname $BASH_SOURCE)/../../../test"
2-
app-test "$(basename $(dirname $BASH_SOURCE))"
1+
# shellcheck shell=bash
2+
3+
source "$(dirname "$BASH_SOURCE")/../../../test"
4+
app-test "$(basename "$(dirname "$BASH_SOURCE")")"

0 commit comments

Comments
 (0)