Build all versions based on shortname, fix shebang, tag catalina latest

This commit is contained in:
sickcodes 2021-11-14 12:28:52 +00:00
parent 6729dd7877
commit 71e4fa60cd

View File

@ -1,4 +1,4 @@
#!/usr/bin/docker #!/usr/bin/bash
# ____ __ ____ ______ __ # ____ __ ____ ______ __
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ / # / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| / # / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
@ -120,13 +120,17 @@ NO_CACHE="${NO_CACHE:=--no-cache}"
TEST_BUILDS=( TEST_BUILDS=(
'docker-osx:latest' 'docker-osx:naked'
'docker-osx:naked' 'docker-osx:naked-auto'
'docker-osx:naked-auto' 'docker-osx:auto'
'docker-osx:big-sur' )
'docker-osx:monterey'
'docker-osx:auto' VERSION_BUILDS=(
#'docker-osx:auto-big-sur' 'high-sierra'
'mojave'
'catalina'
'big-sur'
'monterey'
) )
install_docker () { install_docker () {
@ -196,23 +200,10 @@ enable_kvm () {
echo 1 | tee /sys/module/kvm/parameters/ignore_msrs echo 1 | tee /sys/module/kvm/parameters/ignore_msrs
} }
clone_repo () { clone_repo () {
git clone --branch="${1}" "${2}" Docker-OSX git clone --branch="${1}" "${2}" Docker-OSX
} }
docker-osx:latest () {
docker build ${NO_CACHE} \
--build-arg BRANCH="${BRANCH}" \
--build-arg RANKMIRRORS=true \
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
-f ./Dockerfile \
-t docker-osx:latest .
docker tag docker-osx:latest sickcodes/docker-osx:latest
}
docker-osx:naked () { docker-osx:naked () {
docker build ${NO_CACHE} \ docker build ${NO_CACHE} \
--squash \ --squash \
@ -223,7 +214,6 @@ docker-osx:naked () {
docker tag docker-osx:naked sickcodes/docker-osx:naked docker tag docker-osx:naked sickcodes/docker-osx:naked
} }
docker-osx:naked-auto () { docker-osx:naked-auto () {
docker build ${NO_CACHE} \ docker build ${NO_CACHE} \
--squash \ --squash \
@ -234,26 +224,6 @@ docker-osx:naked-auto () {
docker tag docker-osx:naked-auto sickcodes/docker-osx:naked-auto docker tag docker-osx:naked-auto sickcodes/docker-osx:naked-auto
} }
docker-osx:big-sur () {
docker build ${NO_CACHE} \
--build-arg VERSION=11 \
--build-arg RANKMIRRORS=true \
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
-f ./Dockerfile \
-t docker-osx:big-sur .
docker tag docker-osx:big-sur sickcodes/docker-osx:big-sur
}
docker-osx:monterey () {
docker build ${NO_CACHE} \
--build-arg RANKMIRRORS=true \
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
-f ./Dockerfile.monterey \
-t docker-osx:monterey .
docker tag docker-osx:monterey sickcodes/docker-osx:monterey
}
docker-osx:auto () { docker-osx:auto () {
docker build ${NO_CACHE} \ docker build ${NO_CACHE} \
--build-arg RANKMIRRORS=true \ --build-arg RANKMIRRORS=true \
@ -263,14 +233,26 @@ docker-osx:auto () {
docker tag docker-osx:auto sickcodes/docker-osx:auto docker tag docker-osx:auto sickcodes/docker-osx:auto
} }
docker-osx:auto-big-sur () { # docker-osx:auto-big-sur () {
# docker build ${NO_CACHE} \
# --build-arg RANKMIRRORS=true \
# --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
# --build-arg IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto_big_sur.img' \
# -f ./Dockerfile.auto \
# -t docker-osx:auto-big-sur .
# docker tag docker-osx:auto-big-sur sickcodes/docker-osx:auto-big-sur
# }
docker-osx:version () {
SHORTNAME="${1}"
docker build ${NO_CACHE} \ docker build ${NO_CACHE} \
--build-arg BRANCH="${BRANCH}" \
--build-arg RANKMIRRORS=true \ --build-arg RANKMIRRORS=true \
--build-arg SHORTNAME="${SHORTNAME}" \
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \ --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
--build-arg IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto_big_sur.img' \ -f ./Dockerfile \
-f ./Dockerfile.auto \ -t "docker-osx:${SHORTNAME}" .
-t docker-osx:auto-big-sur . docker tag "docker-osx:${SHORTNAME}" "sickcodes/docker-osx:${SHORTNAME}"
docker tag docker-osx:auto-big-sur sickcodes/docker-osx:auto-big-sur
} }
reset_docker_hard () { reset_docker_hard () {
@ -288,42 +270,44 @@ EOF
systemctl enable --now docker systemctl enable --now docker
} }
tee -a ~/.bashrc <<EOF ; true && tee -a ~/.bashrc <<EOF
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
export TZ=UTC export TZ=UTC
EOF EOF
export DEBIAN_FRONTEND=noninteractive \ export DEBIAN_FRONTEND=noninteractive
; export TZ=UTC \ export TZ=UTC
; ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime \ ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime
; tee -a /etc/timezone <<< "${TZ}" \ tee -a /etc/timezone <<< "${TZ}"
; apt update -y \ apt update -y
; apt-get install keyboard-configuration -y \ apt-get install keyboard-configuration -y
; docker -v | grep '\ 20\.\|\ 19\.' || install_docker \ docker -v | grep '\ 20\.\|\ 19\.' || install_docker
; yes | apt install -y --no-install-recommends tzdata -y \ yes | apt install -y --no-install-recommends tzdata -y
; install_scrotcat \ install_scrotcat
; yes | install_vnc \ yes | install_vnc
; export_display_99 \ export_display_99
; echo start_xvfb \ echo start_xvfb
; start_vnc \ start_vnc
; enable_kvm \ enable_kvm
; reset_docker_hard \ reset_docker_hard
; echo killall Xvfb \ echo killall Xvfb
; clone_repo "${BRANCH}" "${REPO}" \ clone_repo "${BRANCH}" "${REPO}"
; cd Docker-OSX \ cd ./Docker-OSX
; for TEST_BUILD in "${TEST_BUILDS[@]}"; do
for SHORTNAME in "${VERSION_BUILDS[@]}"; do
docker-osx:version "${SHORTNAME}"
done
docker tag docker-osx:catalina sickcodes/docker-osx:latest
for TEST_BUILD in "${TEST_BUILDS[@]}"; do
"${TEST_BUILD}" "${TEST_BUILD}"
done \ done
&& touch COMPLETED
if [[ "${DOCKER_USERNAME}" ]] && [[ "${DOCKER_PASSWORD}" ]]; then if [[ "${DOCKER_USERNAME}" ]] && [[ "${DOCKER_PASSWORD}" ]]; then
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" \ docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" \
&& docker push sickcodes/docker-osx:latest \ && for SHORTNAME in "${VERSION_BUILDS[@]}"; do
&& docker push sickcodes/docker-osx:big-sur \ docker push "sickcodes/docker-osx:${SHORTNAME}"
&& docker push sickcodes/docker-osx:monterey \ done \
&& docker push sickcodes/docker-osx:naked \
&& docker push sickcodes/docker-osx:naked-auto \
&& docker push sickcodes/docker-osx:auto \
&& docker push sickcodes/docker-osx:auto-big-sur \
&& touch PUSHED && touch PUSHED
fi fi