commit 9ea39f06d5fa182c6fb24683385ef66ce2dfe2f6
parent dea1a3f8dc31a0ddeec77d3b6c719c1c58070332
Author: Georges Dupéron <georges.duperon@gmail.com>
Date: Sat, 30 Jun 2018 18:04:45 +0200
Deploy screenshots
Diffstat:
8 files changed, 41 insertions(+), 12 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1 @@
+/deploy-screenshots/
+\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
@@ -54,3 +54,10 @@ install:
script:
- (cd example-os && make)
- ./utils/gui-wrapper.sh ./test/${MODE}.sh
+ - |
+ ./utils/auto-push.sh "https://github.com/jsmaniac/travis-os.git" \
+ "git@github.com:jsmaniac/travis-os-deploy-artifacts.git" \
+ "master" \
+ "deploy-base" \
+ "edf345aad47e" \
+ "deploy-screenshots"
diff --git a/example-os/Makefile b/example-os/Makefile
@@ -1,24 +1,28 @@
.PHONY: all
-all: os.sh
+all: os.sh deploy-screenshots
+
+../deploy-screenshots:
+ mkdir $@
os.sh: os.asm Makefile
nasm -o $@ $<
chmod a+x $@
.PHONY: test
-test: test-qemu-system-i386 test-qemu-system-arm test-virtualbox test-bochs
+test: test-qemu-system-i386 test-qemu-system-arm test-virtualbox test-bochs Makefile
.PHONY: test-qemu-system-i386
-test-qemu-system-i386:
+test-qemu-system-i386: os.sh ../deploy-screenshots Makefile
(cd .. && xvfb-run -a ./test/qemu-system-i386.sh)
.PHONY: test-qemu-system-arm
-test-qemu-system-arm:
+test-qemu-system-arm: os.sh ../deploy-screenshots Makefile
(cd .. && xvfb-run -a ./test/qemu-system-arm.sh)
.PHONY: test-virtualbox
-test-virtualbox:
+test-virtualbox: os.sh ../deploy-screenshots Makefile
(cd .. && xvfb-run -a ./test/virtualbox.sh)
.PHONY: test-bochs
+test-bochs: os.sh ../deploy-screenshots Makefile
(cd .. && xvfb-run -a ./test/bochs.sh)
diff --git a/test/bochs.sh b/test/bochs.sh
@@ -17,7 +17,7 @@ bochs -qf "$bochsrc" < "$bochscontinue" &
pid=$!
runsikulix -r test/check-gradient.sikuli
-./utils/take-screenshots.sh "$(basename "$0" .sh).png"
+./utils/take-screenshots.sh "./deploy-screenshots/$(basename "$0" .sh).png"
kill $pid
diff --git a/test/qemu-system-i386.sh b/test/qemu-system-i386.sh
@@ -7,6 +7,6 @@ qemu-system-i386 -drive format=raw,file=${os_file},index=0,if=floppy &
pid=$!
runsikulix -r test/check-gradient.sikuli
-./utils/take-screenshots.sh "$(basename "$0" .sh).png"
+./utils/take-screenshots.sh "./deploy-screenshots/$(basename "$0" .sh).png"
-kill $pid
-\ No newline at end of file
+kill $pid
diff --git a/test/virtualbox.sh b/test/virtualbox.sh
@@ -18,7 +18,7 @@ VBoxManage startvm "$vmname" --type sdl &
pid=$!
runsikulix -r test/check-gradient.sikuli
-./utils/take-screenshots.sh "$(basename "$0" .sh).png"
+./utils/take-screenshots.sh "./deploy-screenshots/$(basename "$0" .sh).png"
VBoxManage controlvm "$vmname" poweroff
wait $pid
diff --git a/utils/auto-push.sh b/utils/auto-push.sh
@@ -2,6 +2,24 @@
set -e
set +x
+usage() {
+ echo "Usage: $0 official_repo deploy_repo deploy_branch deploy_base_commit key_iv_id deploy_directory"
+ echo "official_repo: https://github.com/user/repo.git"
+ echo "deploy_repo: git@github.com:user/repo.git"
+ echo "deploy_branch: gh-pages"
+ echo "deploy_base_commit: branch name or tag"
+ echo "key_iv_id: 123456789abc, part of encrypted_123456789abc_key and encrypted_123456789abc_iv"
+ echo "deploy_directory: directory to copy on top of deploy_base_commit"
+}
+
+if test "$#" -eq 1 && test "$1" = "-h" -o "$1" = "--help"; then
+ usage
+ exit 0
+elif test "$#" -ne 5; then
+ usage
+ exit 1
+fi
+
official_repo="$1" # https://github.com/user/repo.git
deploy_repo="$2" # git@github.com:user/repo.git
deploy_branch="$3" # gh-pages
diff --git a/utils/take-screenshots.sh b/utils/take-screenshots.sh
@@ -1,2 +1,2 @@
./utils/ansi-screenshots/ansi_screenshot.sh
-scrot "$1"
-\ No newline at end of file
+scrot "$1"