github.com/kubernetes-incubator/kube-aws@v0.16.4/ci/publish-docs-as-bot.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -ve
     4  
     5  # This script:
     6  # - assumes you've created a ssh key used by kube-aws-bot to ssh into github:
     7  #   https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
     8  # - utilizes Travis CI's file encryption feature for encrypting ssh keys
     9  
    10  # It requires the following command beforehand:
    11  #   $ gem install travis
    12  #   $ travis login --auto
    13  #   $ travis encrypt-file ci/kube-aws-bot-git-ssh-key --repo <your github user or organization>/kube-aws
    14  
    15  # And then change this line to the one output from the `travis encrypt-file` command above
    16  openssl aes-256-cbc -K $encrypted_514cf8442810_key -iv $encrypted_514cf8442810_iv -in kube-aws-bot-git-ssh-key.enc -out ci/kube-aws-bot-git-ssh-key -d
    17  
    18  ## Prevent the following error:
    19  ##   Permissions 0644 for '/home/travis/gopath/src/github.com/kubernetes-incubator/kube-aws/ci/kube-aws-bot-git-ssh-key' are too open.
    20  ##   ...
    21  ##   bad permissions: ignore key: /home/travis/gopath/src/github.com/kubernetes-incubator/kube-aws/ci/kube-aws-bot-git-ssh-key
    22  chmod 600 ci/kube-aws-bot-git-ssh-key
    23  
    24  # Finally run the following command to add the encrypted key to the git repo:
    25  #   $ git add kube-aws-bot-git-ssh-key.enc
    26  #   $   $ git commit -m '...'
    27  
    28  echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile $(pwd)/ci/kube-aws-bot-git-ssh-key\n" >> ~/.ssh/config
    29  
    30  set +e
    31  ssh git@github.com
    32  status=$?
    33  set -e
    34  
    35  if [ $status -ne 1 ]; then
    36    echo ssh connection check to github failed: ssh command exited with status $status 1>&2
    37    exit 1
    38  fi
    39  
    40  echo Node.js $(node -v) is installed/being used
    41  
    42  REPO=$TRAVIS_REPO_SLUG make publish-docs