-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-platform builds, delete branch/test tags, and remove GAR [minor] (
#53)
- Loading branch information
Showing
24 changed files
with
326 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Delete Docker Tags with Wildcard | ||
|
||
on: | ||
delete: | ||
branches: | ||
- "**" | ||
workflow_dispatch: | ||
inputs: | ||
tag_pattern: | ||
description: 'Wildcard pattern for Docker tags to delete' | ||
required: true | ||
default: "^branch-name.*" | ||
|
||
jobs: | ||
find-images: | ||
name: Find docker images needing deleted | ||
runs-on: ubuntu-latest | ||
outputs: | ||
dockerFiles: ${{ steps.images.outputs.images }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Find docker files | ||
id: images | ||
run: | | ||
dockerFiles=$(find examples -name Dockerfile | jq -c --raw-input --slurp 'split("\n")| .[0:-1]') | ||
images=$(echo "$dockerFiles" | jq -r '.[]' | \ | ||
awk -F'/' '{print "scyllaridae-" $2}' | \ | ||
jq -R -s '. | split("\n") | .[0:-1] | . + ["scyllaridae"]') | ||
echo "images=$images" >> $GITHUB_OUTPUT | ||
delete-docker-tags: | ||
needs: [find-images] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image: ${{ fromJson(needs.find-images.outputs.images )}} | ||
max-parallel: 1 # go easy on the dockerhub API | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Delete Docker Tags | ||
run: ./ci/delete-tags.sh | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
DOCKER_REGISTRY: "lehighlts" | ||
DOCKER_IMAGE: ${{ matrix.image }} | ||
TAG_PATTERN: "^${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag_pattern || github.ref_name }}.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eou pipefail | ||
|
||
if [ "$TAG_PATTERN" = "" ] || [ "$TAG_PATTERN" = "^.*" ] || [ "$TAG_PATTERN" = "^main.*" ]; then | ||
echo "Not mass deleting" | ||
exit 1 | ||
fi | ||
|
||
echo "Deleting tags matching pattern '$TAG_PATTERN' in repository ${DOCKER_IMAGE}" | ||
|
||
curl -s -o response.json -u "${DOCKER_USERNAME}:${DOCKER_ACCESS_TOKEN}" "https://hub.docker.com/v2/repositories/${DOCKER_REPOSITORY}/${DOCKER_IMAGE}/tags?page_size=100" | ||
TAGS=$(jq -r '.results[].name' response.json) | ||
if [ -z "$TAGS" ] || [ "$TAGS" = "null" ]; then | ||
echo "No tags found or failed to retrieve tags." | ||
exit 1 | ||
fi | ||
|
||
curl -s -o token.json -XPOST \ | ||
-H "Content-Type: application/json" \ | ||
-d '{"username": "'"${DOCKER_USERNAME}"'", "password": "'"${DOCKER_ACCESS_TOKEN}"'"}' \ | ||
"https://hub.docker.com/v2/users/login" | ||
|
||
TOKEN=$(jq -r .token token.json) | ||
if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then | ||
echo "Unable to auth to dockerhub." | ||
exit 1 | ||
fi | ||
|
||
for TAG in $TAGS; do | ||
if [[ "$TAG" =~ $TAG_PATTERN ]]; then | ||
echo "Deleting tag $TAG" | ||
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE \ | ||
-H "Authorization: bearer ${TOKEN}" \ | ||
"https://hub.docker.com/v2/repositories/${DOCKER_REPOSITORY}/${DOCKER_IMAGE}/tags/$TAG/") | ||
if [ "$RESPONSE" -eq 204 ]; then | ||
echo "Tag $TAG deleted successfully." | ||
else | ||
echo "Failed to delete tag $TAG. Response code: $RESPONSE" | ||
fi | ||
fi | ||
done | ||
|
||
rm response.json token.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Title | ||
|
||
## Subtitle | ||
|
||
This is a **bold** text and an *italic* text. | ||
|
||
Here is a bullet list: | ||
- Item 1 | ||
- Item 2 | ||
|
||
And a numbered list: | ||
1. First | ||
2. Second | ||
|
||
Here is an equation: | ||
\[ | ||
E = mc^2 | ||
\] | ||
|
||
A table: | ||
|
||
| Column 1 | Column 2 | | ||
|----------|----------| | ||
| Data 1 | Data 2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
\section{Title}\label{title} | ||
|
||
\subsection{Subtitle}\label{subtitle} | ||
|
||
This is a \textbf{bold} text and an \emph{italic} text. | ||
|
||
Here is a bullet list: - Item 1 - Item 2 | ||
|
||
And a numbered list: 1. First 2. Second | ||
|
||
Here is an equation: {[} E = mc\^{}2 {]} | ||
|
||
A table: | ||
|
||
\begin{longtable}[]{@{}ll@{}} | ||
\toprule\noalign{} | ||
Column 1 & Column 2 \\ | ||
\midrule\noalign{} | ||
\endhead | ||
\bottomrule\noalign{} | ||
\endlastfoot | ||
Data 1 & Data 2 \\ | ||
\end{longtable} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
ARG TAG=main | ||
ARG DOCKER_REPOSITORY=local | ||
ARG DOCKER_REPOSITORY=lehighlts | ||
FROM ${DOCKER_REPOSITORY}/scyllaridae-pandoc:${TAG} | ||
|
||
RUN apk add --no-cache \ | ||
bash==5.2.21-r0 \ | ||
curl==8.5.0-r0 \ | ||
ghostscript==10.04.0-r0 \ | ||
jq==1.7.1-r0 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
curl=8.5.0-2ubuntu10.4 \ | ||
ghostscript=10.02.1~dfsg1-0ubuntu7.4 \ | ||
jq=1.7.1-3build1 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY . /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
ARG TAG=main | ||
ARG DOCKER_REPOSITORY=local | ||
ARG DOCKER_REPOSITORY=lehighlts | ||
FROM ${DOCKER_REPOSITORY}/scyllaridae:${TAG} | ||
|
||
COPY scyllaridae.yml /app/scyllaridae.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
ARG TAG=main | ||
ARG DOCKER_REPOSITORY=local | ||
ARG DOCKER_REPOSITORY=lehighlts | ||
FROM ${DOCKER_REPOSITORY}/scyllaridae:${TAG} | ||
|
||
COPY scyllaridae.yml /app/scyllaridae.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.