diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4be367 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/deploy-screenshots/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 8db0d8a..680e426 100644 --- 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 index 6129058..7a96c84 100644 --- 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 index 1b049d2..c01c7aa 100755 --- 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 index fa0579d..565bc75 100755 --- 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 index a69e5ed..e6a9a71 100755 --- 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 index 7dc75a9..03f9a6d 100755 --- 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 index a0ae229..97a05a9 100755 --- 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"