Skip to content

Commit 26bfc3f

Browse files
author
Matthew X. Economou
committed
stash: broad cleanup pass, including a shellcheck run [wip]
1 parent 4015e5f commit 26bfc3f

6 files changed

Lines changed: 131 additions & 63 deletions

File tree

LICENSE.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,47 @@
11
## A few parts of this project are not in the public domain.
22

3-
### Files licensed under the MIT License
3+
### Files Licensed Under the MIT License
44

5-
Several scripts are adapted from their counterparts in the [Docker Official Image for Python](https://github.com/docker-library/python) (`versions.sh`, `apply-templates.sh`, `update.sh`, `generate-stackbrew-library.sh`, `.github/workflows/ci.yml`, `.github/workflows/verify-templating.yml`) and the [Docker Official Image for PostgreSQL](https://github.com/docker-library/postgres) (`docker-entrypoint.sh`), both provided by Docker, Inc., under the terms of the MIT License.
5+
Several scripts are adapted from their counterparts in the
6+
[Docker Official Image for Python](https://github.com/docker-library/python)
7+
(`versions.sh`, `apply-templates.sh`, `update.sh`,
8+
`generate-stackbrew-library.sh`, `.github/workflows/ci.yml`,
9+
`.github/workflows/verify-templating.yml`) and the
10+
[Docker Official Image for PostgreSQL](https://github.com/docker-library/postgres)
11+
(`docker-entrypoint.sh`), both provided by Docker, Inc., under the
12+
terms of the MIT License.
613

714
## The rest of this project is in the worldwide public domain.
815

9-
As a work of the United States Government, this project is in the public domain within the United States.
16+
As a work of the United States Government, this project is in the
17+
public domain within the United States.
1018

11-
Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication.
19+
Additionally, we waive copyright and related rights in the work
20+
worldwide through the CC0 1.0 Universal public domain dedication.
1221

1322
## CC0 1.0 Universal Summary
1423

15-
This is a human-readable summary of the [Legal Code (read the full text)](https://creativecommons.org/publicdomain/zero/1.0/legalcode).
24+
This is a human-readable summary of the
25+
[Legal Code (read the full text)](https://creativecommons.org/publicdomain/zero/1.0/legalcode).
1626

1727
### No Copyright
1828

19-
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.
29+
The person who associated a work with this deed has dedicated the work
30+
to the public domain by waiving all of his or her rights to the work
31+
worldwide under copyright law, including all related and neighboring
32+
rights, to the extent allowed by law.
2033

21-
You can copy, modify, distribute, and perform the work, even for commercial purposes, all without asking permission.
34+
You can copy, modify, distribute, and perform the work, even for
35+
commercial purposes, all without asking permission.
2236

2337
### Other Information
2438

25-
In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights.
39+
In no way are the patent or trademark rights of any person affected by
40+
CC0, nor are the rights that other persons may have in the work or in
41+
how the work is used, such as publicity or privacy rights.
2642

27-
Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law.
28-
When using or citing the work, you should not imply endorsement by the author or the affirmer.
43+
Unless expressly stated otherwise, the person who associated a work
44+
with this deed makes no warranties about the work, and disclaims
45+
liability for all uses of the work, to the fullest extent permitted by
46+
applicable law. When using or citing the work, you should not imply
47+
endorsement by the author or the affirmer.

README.md

Lines changed: 91 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
# satosa-docker
22

3-
This is the source repository of the [Docker "Official Image"](https://github.com/docker-library/official-images#what-are-official-images) for [`satosa`](https://hub.docker.com/_/satosa/).
3+
This is the source repository of the
4+
[Docker "Official Image"](https://github.com/docker-library/official-images#what-are-official-images)
5+
for [`satosa`](https://hub.docker.com/_/satosa/).
46

5-
The image description on Docker Hub is generated from [the docker-library/docs repository](https://github.com/docker-library/docs), specifically [the `satosa` directory](https://github.com/docker-library/docs/tree/master/satosa).
7+
The image description on Docker Hub is generated from
8+
[the docker-library/docs repository](https://github.com/docker-library/docs),
9+
specifically
10+
[the `satosa` directory](https://github.com/docker-library/docs/tree/master/satosa).
611

712
## See a change merged here that hasn't shown up on Docker Hub?
813

9-
For more information about the Docker "Official Images" change lifecycle, see [the "An image's source changed in Git, now what?" FAQ entry](https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what).
14+
For more information about the Docker "Official Images" change
15+
lifecycle, see
16+
[the "An image's source changed in Git, now what?" FAQ entry](https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what).
1017

11-
For outstanding `satosa` image PRs, check [PRs with the "library/satosa" label on the official-images repository](https://github.com/docker-library/official-images/labels/library%2Fsatosa). For the current "source of truth" for the `satosa` image, see [the `library/satosa` file in the official-images repository](https://github.com/docker-library/official-images/blob/master/library/satosa).
18+
For outstanding `satosa` image PRs, check
19+
[PRs with the "library/satosa" label on the official-images repository](https://github.com/docker-library/official-images/labels/library%2Fsatosa). For
20+
the current "source of truth" for the `satosa` image, see
21+
[the `library/satosa` file in the official-images repository](https://github.com/docker-library/official-images/blob/master/library/satosa).
1222

1323
---
1424

15-
- [![build status badge](https://img.shields.io/github/workflow/status/IdentityPython/satosa-docker/GitHub%20CI/main?label=GitHub%20CI)](https://github.com/IdentityPython/satosa-docker/actions?query=workflow%3A%22GitHub+CI%22+branch%3Amain)
25+
- [![build status badge](https://img.shields.io/github/workflow/status/IdentityPython/satosa-docker/GitHub%20CI/main?label=GitHub%20CI)](https://github.com/IdentityPython/satosa-docker/actions?query=workflow%3A%22GitHub+CI%22+branch%3Amain)
1626

1727
| Build | Status | Badges | (per-arch) |
1828
|:-:|:-:|:-:|:-:|
@@ -24,37 +34,62 @@ For outstanding `satosa` image PRs, check [PRs with the "library/satosa" label o
2434

2535
# Contributing
2636

27-
This project uses the [Git feature branch workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow). Please submit your changes for review as a [GitHub pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests).
37+
This project uses the
38+
[Git feature branch workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow).
39+
Please submit your changes for review as a
40+
[GitHub pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests).
2841

29-
In forks of this repository, enable the GitHub Actions workflows. GitHub Actions runs two workflows when developers push commits to a branch. [Verify Templating](actions/workflows/verify-templating.yml) checks for uncommitted changes. [GitHub CI](actions/workflows/ci.yml) builds and tests the container images.
42+
In forks of this repository, enable the GitHub Actions
43+
workflows. GitHub Actions runs two workflows when developers push
44+
commits to a branch.
45+
[Verify Templating](actions/workflows/verify-templating.yml) checks
46+
for uncommitted changes. [GitHub CI](actions/workflows/ci.yml) builds
47+
and tests the container images.
3048

3149
## Development Environment
3250

3351
This project uses the following software:
3452

35-
- [Docker 20.10 or newer](https://docs.docker.com/engine/install/)
53+
- [Docker 20.10 or newer](https://docs.docker.com/engine/install/);
3654

37-
- [GNU awk](https://www.gnu.org/software/gawk/), [GNU Find Utilities](https://www.gnu.org/software/findutils/), [GNU Wget](https://www.gnu.org/software/wget/), and [jq](https://stedolan.github.io/jq/), for the templating engine and version tracker
55+
- [GNU awk](https://www.gnu.org/software/gawk/),
56+
[GNU Find Utilities](https://www.gnu.org/software/findutils/),
57+
[GNU Wget](https://www.gnu.org/software/wget/), and
58+
[jq](https://stedolan.github.io/jq/), for the templating engine and
59+
version tracker;
3860

39-
- [GNU Make](https://www.gnu.org/software/make/) and [Go](https://go.dev/), required by bashbrew and manifest-tool
61+
- [GNU Make](https://www.gnu.org/software/make/) and
62+
[Go](https://go.dev/), required by bashbrew and manifest-tool;
4063

41-
- [bashbrew](https://github.com/docker-library/bashbrew), the Docker Official Images build tool
64+
- [bashbrew](https://github.com/docker-library/bashbrew), the Docker
65+
Official Images build tool;
4266

43-
- [manifest-tool](https://github.com/estesp/manifest-tool), which generates the shared tag index
67+
- [manifest-tool](https://github.com/estesp/manifest-tool), which
68+
generates the shared tag index; and
4469

45-
- (optional) [qemu-user-static](https://github.com/multiarch/qemu-user-static), to test containers on other hardware architecture via emulation
70+
- (optional)
71+
[qemu-user-static](https://github.com/multiarch/qemu-user-static),
72+
to test containers on other hardware architecture via emulation
4673

47-
Before cloning the repository or working within it, set the [file mode creation mask](https://en.wikipedia.org/wiki/Umask) to `0022` or `u=rwx,g=rx,o=rx`.
74+
Before cloning the repository or working within it, set the
75+
[file mode creation mask](https://en.wikipedia.org/wiki/Umask) to
76+
`0022` or `u=rwx,g=rx,o=rx`.
4877

4978
## Coding Style
5079

51-
Follow [the Docker Official Images review guidelines](https://github.com/docker-library/official-images#review-guidelines) and [Dockerfile best practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/).
80+
Follow
81+
[the Docker Official Images review guidelines](https://github.com/docker-library/official-images#review-guidelines)
82+
and
83+
[Dockerfile best practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/).
5284

53-
In Dockerfiles and shell scripts, please use tabs for indentation instead of spaces.
85+
In Dockerfiles and shell scripts, please use tabs for indentation
86+
instead of spaces.
5487

5588
## Commit Messages
5689

57-
This project uses [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/). Valid commit types are:
90+
This project uses
91+
[Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/).
92+
Valid commit types are:
5893

5994
- **build**—changes to the build system or external dependencies
6095

@@ -68,7 +103,8 @@ This project uses [Conventional Commits 1.0.0](https://www.conventionalcommits.o
68103

69104
- **perf**—a code change that improves performance
70105

71-
- **refactor**—a code change that neither fixes a bug nor adds a feature
106+
- **refactor**—a code change that neither fixes a bug nor adds a
107+
feature
72108

73109
- **test**—new tests or corrections to existing tests
74110

@@ -78,52 +114,63 @@ No commit scopes are currently in use.
78114

79115
In a fork of this repository:
80116

81-
1. Review the list of version aliases at the beginning of `generate-stackbrew-library.sh`.
117+
1. Review the list of version aliases at the beginning of
118+
`generate-stackbrew-library.sh`.
82119

83-
2. Run [update.sh](update.sh), specifying the desired major and minor version of SATOSA. For example:
120+
2. Run [update.sh](update.sh), specifying the desired major and minor
121+
version of SATOSA. For example:
84122

85123
```bash
86124
./update.sh 8.1
87125
```
88126

89-
3. Remove outdated versions of SATOSA or base container images from `versions.json`, and delete the corresponding SATOSA container image definitions from the repository, e.g., the `8.0/` or `8.1/*alpine3.14*/` folders.
127+
3. Remove outdated versions of SATOSA or base container images from
128+
`versions.json`, and delete the corresponding SATOSA container
129+
image definitions from the repository, e.g., the `8.0/` or
130+
`8.1/*alpine3.14*/` folders.
90131

91-
4. Mention the new SATOSA or base container version in the commit message subject, reference the release announcement in the commit message body. For example:
132+
4. Mention the new SATOSA or base container version in the commit
133+
message subject, reference the release announcement in the commit
134+
message body. For example:
92135

93-
```
94-
feat: version bump to SATOSA v8.1.0
136+
```
137+
feat: version bump to SATOSA v8.1.0
95138
96-
Cf. https://github.com/IdentityPython/SATOSA/commit/d44b54433c5b817cf0409855881f6f2c80c27f5c
97-
```
139+
Cf. https://github.com/IdentityPython/SATOSA/commit/d44b54433c5b817cf0409855881f6f2c80c27f5c
140+
```
98141

99-
Or for example:
142+
Or for example:
100143

101-
```
102-
feat: version bump to Alpine Linux v3.16
144+
```
145+
feat: version bump to Alpine Linux v3.16
103146
104-
Cf. https://www.alpinelinux.org/posts/Alpine-3.16.0-released.html
105-
```
147+
Cf. https://www.alpinelinux.org/posts/Alpine-3.16.0-released.html
148+
```
106149

107-
5. Submit a pull request after both GitHub Actions workflows complete successfully.
150+
5. Submit a pull request after both GitHub Actions workflows complete
151+
successfully.
108152

109-
After accepting a pull request, fork and edit [the Docker Official Images library entry for SATOSA](https://github.com/docker-library/official-images/edit/master/library/satosa):
153+
After accepting a pull request, fork and edit
154+
[the Docker Official Images library entry for SATOSA](https://github.com/docker-library/official-images/edit/master/library/satosa):
110155

111-
1. Replace its contents with the output of [generate-stackbrew-library.sh](generate-stackbrew-library.sh).
156+
1. Replace that file's contents with the output of
157+
[generate-stackbrew-library.sh](generate-stackbrew-library.sh).
112158

113-
2. Use a commit message referencing the release announcement. For example:
159+
2. Use a commit message referencing the release announcement. For
160+
example:
114161

115-
```
116-
Update SATOSA to v8.0.1
162+
```
163+
Update SATOSA to v8.0.1
117164
118-
Cf. https://github.com/IdentityPython/SATOSA/commit/1a408439a6b8855346e5ca2c645dee6ab1ce8c0a
119-
```
165+
Cf. https://github.com/IdentityPython/SATOSA/commit/1a408439a6b8855346e5ca2c645dee6ab1ce8c0a
166+
```
120167

121-
Or for example:
168+
Or for example:
122169

123-
```
124-
Update SATOSA base container images to Alpine Linux v3.16
170+
```
171+
Update SATOSA base container images to Alpine Linux v3.16
125172
126-
Cf. https://www.alpinelinux.org/posts/Alpine-3.16.0-released.html
127-
```
173+
Cf. https://www.alpinelinux.org/posts/Alpine-3.16.0-released.html
174+
```
128175

129176
3. Submit a pull request when finished.

apply-templates.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fi
99
jqt='.jq-template.awk'
1010
if [ -n "${BASHBREW_SCRIPTS:-}" ]; then
1111
jqt="$BASHBREW_SCRIPTS/jq-template.awk"
12-
elif [ "$BASH_SOURCE" -nt "$jqt" ]; then
12+
elif [ "${BASH_SOURCE[0]}" -nt "$jqt" ]; then
1313
# https://github.com/docker-library/bashbrew/blob/master/scripts/jq-template.awk
1414
wget -qO "$jqt" 'https://github.com/docker-library/bashbrew/raw/1da7341a79651d28fbcc3d14b9176593c4231942/scripts/jq-template.awk'
1515
fi

generate-stackbrew-library.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ declare -A aliases=(
55
[8.4]='8 latest'
66
)
77

8-
self="$(basename "$BASH_SOURCE")"
9-
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
8+
self="$(basename "${BASH_SOURCE[0]}")"
9+
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
1010

1111
if [ "$#" -eq 0 ]; then
1212
versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)"
@@ -69,7 +69,7 @@ getArches 'satosa'
6969
cat <<-EOH
7070
# This file is generated via https://github.com/IdentityPython/satosa-docker/blob/$(fileCommit "$self")/$self
7171
72-
Maintainers: Matthew X. Economou <economoum@niaid.nih.gov> (@niheconomoum)
72+
Maintainers: Matthew X. Economou <xenophon+idpy@irtnog.org> (@xenophonf)
7373
GitRepo: https://github.com/IdentityPython/satosa-docker.git
7474
GitFetch: refs/heads/main
7575
EOH

update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -Eeuo pipefail
33

4-
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
4+
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
55

66
./versions.sh "$@"
77
./apply-templates.sh "$@"

versions.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -Eeuo pipefail
33
shopt -s nullglob
44

55
# operate in same directory as this script
6-
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
6+
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
77

88
# when bootstrapping, create a directory for each desired SATOSA
99
# version, then run this script with no arguments
@@ -21,9 +21,11 @@ eval $(
2121
curl -s https://raw.githubusercontent.com/docker-library/python/master/versions.json \
2222
| jq -r '
2323
. as $versions
24-
| [ $versions|keys[] | select(contains("-rc") | not) ] | sort_by(split(".") | map(tonumber)) | last as $latest
25-
| [ $versions | .[$latest].variants[] | select(test("alpine3.19|slim-bookworm")) ] | join(" ") as $variants
26-
| @sh "export python_version=\($latest) variants=\($variants)"
24+
| [ $versions|keys[] | select(contains("-rc") | not) ] | sort_by(split(".") | map(tonumber)) | last as $latest_python
25+
| [ $versions | .[$latest].variants[] | select(test("alpine")) ] | sort_by(ltrimstr("alpine") | split(".") | map(tonumber)) | last as $latest_alpine
26+
| [ $versions | .[$latest].variants[] | select(test("slim-bookworm")) ] | join(" ") as $latest_debian
27+
| $latest_alpine + " " + $latest_debian as $variants
28+
| @sh "export python_version=\($latest_python) variants=\($variants)"
2729
'
2830
)
2931

0 commit comments

Comments
 (0)