Skip to content

Commit

Permalink
migrate updater to use jinja templating (#447)
Browse files Browse the repository at this point in the history
* migrate updater to use jinja templating

* remove dockerfile updates

* add CI tests

* fix suggestions

* fix suggestions

* update config
  • Loading branch information
gdams authored Oct 25, 2023
1 parent bcc9631 commit 5d4f312
Show file tree
Hide file tree
Showing 32 changed files with 714 additions and 2,121 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Jinja CI
on:
pull_request:
paths:
- generate_dockerfiles.py
- test_generate_dockerfiles.py
branches: [ main ]

permissions:
contents: read

jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.x"

- name: Install dependencies
run: "pip3 install -r requirements.txt"

- name: Run tests
run: "python3 test_generate_dockerfiles.py"
2 changes: 1 addition & 1 deletion .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Run Sanity Check Script
run: " bash sanity.sh"
run: "bash sanity.sh"
9 changes: 8 additions & 1 deletion .github/workflows/updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ jobs:
with:
persist-credentials: false

- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.x"

- name: Install dependencies
run: "pip3 install -r requirements.txt"

- name: Run updater
run: " bash update_all.sh"
run: "python3 generate_dockerfiles.py"

- uses: gr2m/create-or-update-pull-request-action@dc1726cbf4dd3ce766af4ec29cfb660e0125e8ee # v1
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ official-eclipse-temurin
*hotspot.txt
library/
.vscode/
__pycache__/
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,15 @@ This section is for maintainers of the containers repository.
### Hourly automated Job

A [Updater GitHub Action](.github/workflows/updater.yml) runs every 30 mins which triggers the
[`./update_all.sh`](./update_all.sh) script to update the Dockerfiles by creating a Pull Request containing any changes.
[`./generate_dockerfiles.py`](./generate_dockerfiles.py) script to update the Dockerfiles by creating a Pull Request containing any changes.

#### update_all.sh
#### generate_dockerfiles.py

[`./update_all.sh`](./update_all.sh) is a wrapper script to control what is passed into [`./update_multiarch.sh`](./update_multiarch.sh).

#### update_multiarch.sh

[`./update_multiarch.sh`](./update_multiarch.sh) loops around the configuration for which versions and architectures are supported in [`./common_functions.sh`](./common_functions.sh) and uses a bunch of small functions in [`./dockerfile_functions.sh`](./dockerfile_functions.sh) to write the Dockerfiles.

### Manual Release

During a release you can also run [`./update_all.sh`](./update_all.sh) manually by heading to The [GitHub Action definition](https://github.com/adoptium/containers/actions/workflows/updater.yml) and clicking the **Run Workflow** button and making sure the `main` (default) branch is selected, then click the next **Run Workflow** button.
During a release you can also run [`./generate_dockerfiles.py`](./generate_dockerfiles.py) manually by heading to The [GitHub Action definition](https://github.com/adoptium/containers/actions/workflows/updater.yml) and clicking the **Run Workflow** button and making sure the `main` (default) branch is selected, then click the next **Run Workflow** button.

### Review and Merge PR

Expand Down
Loading

0 comments on commit 5d4f312

Please sign in to comment.