Skip to content

Commit

Permalink
feat: builds on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Feb 3, 2024
1 parent 73aed47 commit 1f975aa
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## lo alias

Linux
> ip addr add 172.16.0.1/32 dev lo label lo:1
Mac
> /sbin/ifconfig lo0 alias 172.16.0.1
## mount

Linux
> sshfs -o allow_other [email protected]:/Volumes/TB5 /home/michael/TB5
40 changes: 36 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,17 @@ while [[ $URL != "" ]]; do
digestOld=$(echo "${digestOld}" | sed -E '/buildx\:/d')
fi
if [[ "${digestCurrent}" != "" ]]; then
currentBuildFile=$(echo "${digestCurrent}" | grep -oE '^sha256:.*$' | md5)
currentBuildFile=""
if [[ "$(which md5)" != "" ]]; then
currentBuildFile=$(echo "${digestCurrent}" | grep -oE '^sha256:.*$' | md5)
fi
if [[ "$(which md5sum)" != "" ]]; then
currentBuildFile=$(echo "${digestCurrent}" | grep -oE '^sha256:.*$' | md5sum | grep -oE '^[^ ]+')
fi
if [[ "${currentBuildFile}" == "" ]]; then
echo "Cannot calculate md5 sum for the digestCurrent"
exit 1
fi
if [[ -f "./buildx-data/index/${currentBuildFile}" ]]; then
digestBuildX=$(
echo "${digestBuildX}" && \
Expand All @@ -182,7 +192,17 @@ while [[ $URL != "" ]]; do
fi
fi
if [[ "${digestOld}" != "" ]]; then
currentBuildFile=$(echo "${digestOld}" | grep -oE '^sha256:.*$' | md5)
currentBuildFile=""
if [[ "$(which md5)" != "" ]]; then
currentBuildFile=$(echo "${digestOld}" | grep -oE '^sha256:.*$' | md5)
fi
if [[ "$(which md5sum)" != "" ]]; then
currentBuildFile=$(echo "${digestOld}" | grep -oE '^sha256:.*$' | md5sum | grep -oE '^[^ ]+')
fi
if [[ "${currentBuildFile}" == "" ]]; then
echo "Cannot calculate md5 sum for the digestOld"
exit 1
fi
if [[ -f "./buildx-data/index/${currentBuildFile}" ]]; then
digestBuildX=$(
echo "${digestBuildX}" && \
Expand Down Expand Up @@ -243,8 +263,20 @@ while [[ $URL != "" ]]; do
fi && \
digestCurrent=$(echo "${digestCurrent}" | sed -E '/version:/d' && echo "version:${version}") && \
digestBuildX=$(cat ./buildx-data/index.json | jq -r '.manifests[].digest') && \
digestCurrent=$(echo "${digestCurrent}" | sed -E '/buildx:/d' && echo "buildx:${digestBuildX}") && \
currentBuildFile=$(echo "${digestCurrent}" | grep -oE '^sha256:.*$' | md5) && \
digestCurrent=$(echo "${digestCurrent}" | sed -E '/buildx:/d' && echo "buildx:${digestBuildX}")

currentBuildFile=""
if [[ "$(which md5)" != "" ]]; then
currentBuildFile=$(echo "${digestCurrent}" | grep -oE '^sha256:.*$' | md5)
fi
if [[ "$(which md5sum)" != "" ]]; then
currentBuildFile=$(echo "${digestCurrent}" | grep -oE '^sha256:.*$' | md5sum | grep -oE '^[^ ]+')
fi
if [[ "${currentBuildFile}" == "" ]]; then
echo "Cannot calculate md5 sum for the template"
exit 1
fi

echo "${digestBuildX}" > "./buildx-data/index/${currentBuildFile}" && \
rm Dockerfile
code="${?}"
Expand Down
Empty file modified init-buildx.sh
100644 → 100755
Empty file.

0 comments on commit 1f975aa

Please sign in to comment.