-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
refactoring
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.deb | ||
archs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
sudo: required | ||
services: docker | ||
language: bash | ||
env: | ||
- VERSION=2.8.1 | ||
branches: | ||
only: | ||
- master | ||
before_script: | ||
- sudo apt-get install jq | ||
- wget -N http://ftp.debian.org/debian/pool/main/q/qemu/qemu-user-static_2.8+dfsg-3_amd64.deb | ||
- sudo dpkg -i qemu-user-static_2.8+dfsg-3_amd64.deb | ||
script: | ||
- sudo ./publish.sh -v "$VERSION" -t "$GITHUB_TOKEN" | ||
- sudo ./update.sh -v "$VERSION" | ||
after_success: | ||
- if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker push multiarch/qemu-user-static; fi |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# A POSIX variable | ||
OPTIND=1 # Reset in case getopts has been used previously in the shell. | ||
|
||
while getopts "v:t:" opt; do | ||
case "$opt" in | ||
v) VERSION=$OPTARG | ||
;; | ||
t) GITHUB_TOKEN=$OPTARG | ||
;; | ||
esac | ||
done | ||
|
||
shift $((OPTIND-1)) | ||
|
||
[ "$1" = "--" ] && shift | ||
|
||
mkdir releases | ||
cp /usr/bin/qemu-*-static releases/ | ||
cd releases/ | ||
for file in *; do | ||
tar -czf $file.tar.gz $file; | ||
cp $file.tar.gz x86_64_$file.tar.gz | ||
done | ||
|
||
release_id=$(curl -sL -X POST \ | ||
-H "Content-Type: application/json" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: token ${GITHUB_TOKEN}" \ | ||
-H "Cache-Control: no-cache" -d "{ | ||
\"tag_name\": \"v${VERSION}\", | ||
\"target_commitish\": \"master\", | ||
\"name\": \"v${VERSION}\", | ||
\"body\": \"# \`qemu-*-static\` @ ${VERSION}\", | ||
\"draft\": false, | ||
\"prerelease\": false | ||
}" "https://api.github.com/repos/multiarch/qemu-user-static/releases" | jq -r ".id") | ||
|
||
for file in *; do | ||
content_type=$(file --mime-type -b ${file}) | ||
curl -sL \ | ||
-H "Authorization: token ${GITHUB_TOKEN}" \ | ||
-H "Content-Type: ${content_type}" \ | ||
--upload-file ${file} \ | ||
"https://uploads.github.com/repos/multiarch/qemu-user-static/releases/${release_id}/assets?name=${file}" | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,33 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
set -e | ||
|
||
from_archs="x86_64" | ||
to_archs="$(cat all-archs)" | ||
# A POSIX variable | ||
OPTIND=1 # Reset in case getopts has been used previously in the shell. | ||
|
||
for from_arch in $from_archs; do | ||
for to_arch in $to_archs; do | ||
mkdir -p archs/$from_arch-$to_arch | ||
cat > archs/$from_arch-$to_arch/Dockerfile <<EOF | ||
while getopts "v:" opt; do | ||
case "$opt" in | ||
v) VERSION=$OPTARG | ||
;; | ||
esac | ||
done | ||
|
||
shift $((OPTIND-1)) | ||
|
||
[ "$1" = "--" ] && shift | ||
|
||
from_arch="x86_64" | ||
to_archs=("aarch64" "alpha" "arm" "armeb" "cris" "i386" "m68k" "microblaze" "microblazeel" "mips" "mips64" "mips64el" "mipsel" "mipsn32" "mipsn32el" "or32" "ppc" "ppc64" "ppc64abi32" "ppc64le" "s390x" "sh4" "sh4eb" "sparc" "sparc32plus" "sparc64" "tilegx" "x86_64") | ||
|
||
for to_arch in "${to_archs[@]}"; do | ||
if [ "$from_arch" != "$to_arch" ]; then | ||
mkdir -p archs/$from_arch-$to_arch | ||
cat > archs/$from_arch-$to_arch/Dockerfile <<EOF | ||
FROM scratch | ||
ADD https://github.com/multiarch/qemu-user-static/releases/download/v2.8.0/${from_arch}_qemu-${to_arch}-static.tar.gz /usr/bin | ||
ADD https://github.com/multiarch/qemu-user-static/releases/download/v${VERSION}/${from_arch}_qemu-${to_arch}-static.tar.gz /usr/bin | ||
EOF | ||
docker build -t multiarch/qemu-user-static:$from_arch-$to_arch archs/$from_arch-$to_arch | ||
if [ "$from_arch" = "x86_64" ]; then | ||
docker tag -f multiarch/qemu-user-static:$from_arch-$to_arch multiarch/qemu-user-static:$to_arch | ||
fi | ||
done | ||
docker build -t multiarch/qemu-user-static:$from_arch-$to_arch archs/$from_arch-$to_arch | ||
docker tag multiarch/qemu-user-static:$from_arch-$to_arch multiarch/qemu-user-static:$to_arch | ||
fi | ||
done | ||
|
||
docker build -t multiarch/qemu-user-static:register register |