Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Corretto 16 #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/generate-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Verify repository and generate tags

on: [pull_request_target]

jobs:
verify-repository-content:
name: Verify repository content
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Generate repository content from version
run: |
bash bin/update-dockerfiles.sh
git diff | tee ${GITHUB_WORKSPACE}/pr.diff
- name: Generate tags for pr
run: |
python3 bin/tag-generator.py | tee ${GITHUB_WORKSPACE}/.tags
- name: Add Comment to PR
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
commentText = 'Diff for ' + context.payload.pull_request.head.sha + ':\n\n'
needNewComment = true;
console.log('Reviewing existing comments...');
for await (const { data: comments } of github.paginate.iterator(
github.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
}
)) {
for (const comment of comments) {
if (comment.user.login === 'github-actions[bot]') {
if (needNewComment && comment.body.includes(commentText)) {
needNewComment = false;
} else {
console.log('Deleting comment: ' + comment.id);
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
});
}
}
}
}
if (needNewComment) {
const fs = require('fs');
diff = fs.readFileSync(process.env.GITHUB_WORKSPACE + '/pr.diff').toString().trimEnd();

if (diff) {
commentText = commentText + "\n```\n" + diff + "\n```\n"

} else {
commentText = commentText + "The repository contains the expected content"
}

tags = fs.readFileSync(process.env.GITHUB_WORKSPACE + '/.tags').toString().trimEnd();
commentText = commentText + "<details>\n<summary>updated tags for [library/amazoncorretto](https://github.com/docker-library/official-images/blob/master/library/amazoncorretto)</summary>\n"
commentText = commentText + "\n```\n" + tags + "\n```\n</details>"
console.log('Creating new comment...');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: commentText,
});
}



31 changes: 0 additions & 31 deletions 16/jdk/al2/Dockerfile

This file was deleted.

22 changes: 0 additions & 22 deletions 16/jdk/alpine/3.12/Dockerfile

This file was deleted.

22 changes: 0 additions & 22 deletions 16/jdk/alpine/3.13/Dockerfile

This file was deleted.

22 changes: 0 additions & 22 deletions 16/jdk/alpine/3.14/Dockerfile

This file was deleted.

26 changes: 0 additions & 26 deletions 16/jdk/debian/Dockerfile

This file was deleted.

66 changes: 0 additions & 66 deletions 16/slim/al2/Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions 16/slim/alpine/Dockerfile

This file was deleted.

37 changes: 0 additions & 37 deletions 16/slim/debian/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion 17/jdk/al2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM amazonlinux:2

ARG version=17.0.1.12-1
ARG version=17.0.1.12-6
# In addition to installing the Amazon corretto, we also install
# fontconfig. The folks who manage the docker hub's
# official image library have found that font management
Expand Down
41 changes: 41 additions & 0 deletions bin/tag-generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import json

DEFAULT_ALPINE_VERSION = '3.12'

def generate_tags(key, version):
update = version.split('.')[1] if (key == '8') else version.split('.')[2]
expanded_version = f"{key}u{update}" if (key == '8') else f"{key}.0.{update}"

al2_tags = [f"{key}", f"{expanded_version}", f"{expanded_version}-al2", f"{key}-al2-full",f"{key}-al2-jdk"]
if key == '8':
al2_tags.append('latest')
print("Tags: " + ", ".join(al2_tags) + "")
print("Architectures: amd64, arm64v8")
print(f"Directory: {key}/jdk/al2\n")

for alpine_version in ['3.12', '3.13', '3.14']:
alpine_tags = [f"{key}-alpine{alpine_version}", f"{expanded_version}-alpine{alpine_version}", f"{key}-alpine{alpine_version}-full", f"{key}-alpine{alpine_version}-jdk"]
if alpine_version == DEFAULT_ALPINE_VERSION:
alpine_tags.extend([f"{key}-alpine", f"{expanded_version}-alpine", f"{key}-alpine-full", f"{key}-alpine-jdk"])
print("Tags: " + ", ".join(alpine_tags) + "")
print("Architectures: amd64")
print(f"Directory: {key}/jdk/alpine/{alpine_version}\n")
if key == '8':
alpine_jre_tags = [f"{key}-alpine{alpine_version}-jre", f"{expanded_version}-alpine{alpine_version}-jre"]
if alpine_version == DEFAULT_ALPINE_VERSION:
alpine_jre_tags.extend([f"{key}-alpine-jre", f"{expanded_version}-alpine-jre"])
print("Tags: " + ", ".join(alpine_jre_tags) + "")
print("Architectures: amd64")
print(f"Directory: {key}/jre/alpine/{alpine_version}\n")


def main():
with open('versions.json','r') as version_file:
versions = json.load(version_file)

with open('.tags', 'w') as tag_file:
for key in versions:
generate_tags(key, versions[key])

if __name__ == "__main__":
main()
Loading