File: push_latest_docs.sh

package info (click to toggle)
aseba-plugin-blockly 20180211%2Bgit-3
  • links: PTS
  • area: non-free
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 64,568 kB
  • sloc: javascript: 504,479; xml: 7,976; python: 2,314; sh: 261; lisp: 24; makefile: 10
file content (40 lines) | stat: -rwxr-xr-x 1,686 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

# Deploy the gh-pages branch, adapted from
# https://github.com/google/dagger/blob/master/util/generate-latest-docs.sh
# See also http://stackoverflow.com/a/22977235 for ssh-based deploy.

set -e

# Only push if we've just committed to google/closure-library:master.
# Start by decrypting the deploy password, and pre-populate GitHub's
# RSA key to avoid needing to manually accept it when connecting.
if [ "$TRAVIS_REPO_SLUG" == "google/closure-library" -a \
     "$TRAVIS_PULL_REQUEST" == "false" -a \
     "$TRAVIS_BRANCH" == "master" ]; then 

  # If we're on travis, use a secure $deploy_password
  if [ -n "$deploy_password" ]; then
    touch scripts/ci/deploy
    chmod 600 scripts/ci/deploy
    openssl aes-256-cbc -k "$deploy_password" -d -a \
            -in scripts/ci/deploy.enc -out scripts/ci/deploy \
            &> /dev/null
    echo -e "Host github.com\n  IdentityFile $PWD/scripts/ci/deploy" > ~/.ssh/config
    echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6Tb
          Qa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsd
          lLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+S
          e8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOz
          QgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA
          8VJiS5ap43JXiUFFAaQ==" | sed 's/^ *//' | tr -d '\n' > ~/.ssh/known_hosts
  fi

  # Push the commit and delete the repo.
  export GIT_WORK_TREE="$GH_PAGES"
  export GIT_DIR="$GH_PAGES/.git"
  git push -fq origin gh-pages > /dev/null
  rm -f scripts/ci/deploy
  rm -rf "$GH_PAGES"
  echo "Published gh-pages."

fi