Skip to content

Commit

Permalink
improve display of mediawiki tables
Browse files Browse the repository at this point in the history
also update builder from template
  • Loading branch information
madebyTimo committed Dec 4, 2024
1 parent 1f325a0 commit 569305f
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 17 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/check-version-increment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ jobs:
uses: actions/setup-node@v4
- name: Download script
run: |
curl --silent --output check-version-increment.sh \
https://gitlab.com/madebyTimo/scripts-development/-/raw/main/scripts/\
check-version-increment.sh \
&& chmod +x check-version-increment.sh
curl --silent --output check-version-increment.sh \
https://gitlab.com/madebyTimo/scripts-development/-/raw/main/scripts/\
check-version-increment.sh \
&& chmod +x check-version-increment.sh
- name: Test version increment
if: startsWith(github.ref, '/refs/heads/feature/') ||
startsWith(github.ref, '/refs/heads/bugfix/')
run: ./check-version-increment.sh --file --new new/Version.txt --old old/Version.txt
- name: Test version same
if: ${{ !( startsWith(github.ref, '/refs/heads/feature/') ||
startsWith(github.ref, '/refs/heads/bugfix/') ) }}
run: "[[ $(cat new/Version.txt) == $(cat old/Version.txt) ]]"
run: |
BRANCH="${GITHUB_HEAD_REF#/ref/head}"
echo "Branch to check: $BRANCH"
if [[ "$BRANCH" == @(feature|bugfix)/* ]]; then
./check-version-increment.sh --file --new new/Version.txt \
--old old/Version.txt
else
[[ $(cat new/Version.txt) == $(cat old/Version.txt) ]]
fi
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# folders
.idea
.temp*
.vscode
builds
data-local
Expand All @@ -10,3 +11,6 @@ test-results
# files
.iml
package-lock.json

# exclude
!.vscode/launch.json
2 changes: 1 addition & 1 deletion Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.0
v0.2.0
26 changes: 22 additions & 4 deletions builder/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
set -e

BUILD_ARGUMENTS=()
DEPENDENCIES=(docker)
BUILDER_EXPORT_DOCKER_ARCHIVE="${BUILDER_EXPORT_DOCKER_ARCHIVE:-true}"
DEPENDENCIES=(docker zstd)
UPDATE_BASE=false
PLATFORMS=(amd64 arm64)
REGISTRY_USER="madebytimo"
Expand Down Expand Up @@ -65,7 +66,24 @@ fi

PLATFORMS_STRING="${PLATFORMS[*]}"
BUILD_ARGUMENTS+=(--platform "${PLATFORMS_STRING// /,}")
OUTPUT_FILE="builds/${IMAGE//"/"/-}-${VERSION}-oci.tar"

docker buildx build "${BUILD_ARGUMENTS[@]}" \
--output type=oci,dest=builds/"${IMAGE//"/"/-}-${VERSION}.tar" --tag "${IMAGE}:latest" \
--tag "${IMAGE}:${VERSION}" --tag "${IMAGE}:${VERSION}-base-${BASE_IMAGE_DATE}" .
docker buildx build "${BUILD_ARGUMENTS[@]}" --output \
"type=oci,dest=${OUTPUT_FILE},compression=zstd,compression-level=19,force-compression=true" \
--tag "${IMAGE}:latest" --tag "${IMAGE}:${VERSION}" \
--tag "${IMAGE}:${VERSION}-base-${BASE_IMAGE_DATE}" .

if [[ "$BUILDER_EXPORT_DOCKER_ARCHIVE" == true ]]; then
docker pull --quiet quay.io/skopeo/stable > /dev/null
rm -f builds/.temp-docker-archive.tar
for PLATFORM in "${PLATFORMS[@]}"; do
docker run --interactive --rm --volume "${PWD}/builds:/builds" \
quay.io/skopeo/stable copy --additional-tag "${IMAGE}:latest" --additional-tag \
"${IMAGE}:${VERSION}" --additional-tag "${IMAGE}:${VERSION}-base-${BASE_IMAGE_DATE}" \
--override-arch "$PLATFORM" --quiet "oci-archive:${OUTPUT_FILE}:latest" \
"docker-archive:builds/.temp-docker-archive.tar"
zstd -19 --force --quiet -T0 builds/.temp-docker-archive.tar \
-o "${OUTPUT_FILE%oci.tar}${PLATFORM}.tar.zst"
rm -f builds/.temp-docker-archive.tar
done
fi
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ fi
function convertToMediaWiki {
local DOCUMENT="$1"
local CONVERTED_DOCUMENT="${2}.mediawiki"
pandoc --to mediawiki --output "$CONVERTED_DOCUMENT" "$DOCUMENT"
pandoc --to mediawiki "$DOCUMENT" \
| sed --in-place 's/^\({|\)$/\1 class="wikitable sortable filterable"/' \
> "$CONVERTED_DOCUMENT"
}

function convertToPdf {
Expand Down

0 comments on commit 569305f

Please sign in to comment.