commit 118be99a3a3c001110a4647572b728fca9641525
parent 74ce426c80758ff5f05c65c15412dee32310a4e5
Author: Georges Dupéron <georges.duperon@gmail.com>
Date: Tue, 3 Jul 2018 21:34:34 +0200
Save screenshots for master and dev, in separate branches
Diffstat:
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/.travis.yml b/.travis.yml
@@ -89,7 +89,8 @@ script:
- |
./utils/auto-push.sh "https://github.com/jsmaniac/travis-os.git" \
"git@github.com:jsmaniac/travis-os-deploy-artifacts.git" \
- "screenshots-$MODE" \
+ "screenshots-$TRAVIS_BRANCH-$MODE" \
"deploy-base" \
"edf345aad47e" \
- "deploy-screenshots"
+ "deploy-screenshots" \
+ "$(if test "$TRAVIS_BRANCH" = "master"; then echo master; else echo dev; fi)"
diff --git a/README.md b/README.md
@@ -6,20 +6,20 @@ Below are screenshots of an example operating system. This example merely displa
## QEMU
-
+
## VirtualBox
-
+
## Bochs
-
+
## DOSBox (.bat)
-
+
## Unix graphical environment (.sh)
-
+
diff --git a/utils/auto-push.sh b/utils/auto-push.sh
@@ -10,12 +10,13 @@ usage() {
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"
+ echo "from_branch: master # allow push only when building the given branch"
}
if test "$#" -eq 1 && test "$1" = "-h" -o "$1" = "--help"; then
usage
exit 0
-elif test "$#" -ne 6; then
+elif test "$#" -ne 7; then
usage
exit 1
fi
@@ -26,6 +27,7 @@ deploy_branch="$3" # gh-pages
deploy_base_commit="$4" # branch name or tag
key_iv_id="$5" # 123456789abc, part of encrypted_123456789abc_key and encrypted_123456789abc_iv
deploy_directory="$6" # directory to copy on top of deploy_base_commit
+from_branch="$7" # master # allow push only when building the given branch
key_env_var_name="encrypted_${key_iv_id}_key"
iv_env_var_name="encrypted_${key_iv_id}_iv"
key="$(sh -c 'echo "${'"$key_env_var_name"'}"')"
@@ -35,8 +37,8 @@ if test "$(git config remote.origin.url)" != "$official_repo"; then
echo "Not on official repo, will not deploy to ${deploy_repo}:${deploy_branch}."
elif test "$TRAVIS_PULL_REQUEST" != "false"; then
echo "This is a Pull Request, will not deploy to ${deploy_repo}:${deploy_branch}."
-elif test "$TRAVIS_BRANCH" != "master"; then
- echo "Not on master branch (TRAVIS_BRANCH = $TRAVIS_BRANCH), will not deploy to ${deploy_repo}:${deploy_branch}."
+elif test "$TRAVIS_BRANCH" != "$from_branch"; then
+ echo "Not on $from_branch branch (TRAVIS_BRANCH = $TRAVIS_BRANCH), will not deploy to ${deploy_repo}:${deploy_branch}."
elif test -z "${key:-}" -o -z "${iv:-}"; then
echo "Travis CI secure environment variables are unavailable, will not deploy to ${deploy_repo}:${deploy_branch}."
elif test ! -e travis-deploy-key-id_rsa.enc; then
@@ -69,6 +71,6 @@ else
rsync -a "${deploy_directory}/" "${TRAVIS_AUTO_PUSH_REPO_DIR}/"
(cd "$TRAVIS_AUTO_PUSH_REPO_DIR" && git add -A . && git commit --allow-empty -m "Auto-publish to $deploy_branch") > commit.log || (cat commit.log && exit 1)
(cd "$TRAVIS_AUTO_PUSH_REPO_DIR" && git log --oneline --decorate --graph -10)
- echo '(cd '"$TRAVIS_AUTO_PUSH_REPO_DIR"' && git push --force --quiet "'"$deploy_repo"'" "master:'"$deploy_branch"'")'
+ echo '(cd '"$TRAVIS_AUTO_PUSH_REPO_DIR"' && git push --force --quiet "'"$deploy_repo"'" "'"$deploy_branch"'")'
(cd "$TRAVIS_AUTO_PUSH_REPO_DIR" && git push --force --quiet "$deploy_repo" "$deploy_branch" >/dev/null 2>&1) >/dev/null 2>&1 # redirect to /dev/null to avoid showing credentials.
fi