blob: c9b7f156b09a1dd377ceb4cfa85cca280f8776af [file] [log] [blame]
Narayan Kamath166772b2013-11-04 16:04:55 +00001#!/bin/bash
2
3set -ex
4
5REPO="git@github.com:square/okhttp.git"
Narayan Kamath166772b2013-11-04 16:04:55 +00006DIR=temp-clone
7
8# Delete any existing temporary website clone
9rm -rf $DIR
10
11# Clone the current repo into temp folder
12git clone $REPO $DIR
13
14# Move working directory into temp folder
15cd $DIR
16
17# Checkout and track the gh-pages branch
18git checkout -t origin/gh-pages
19
Tobias Thierer6c251e22016-06-24 19:04:17 +010020# Delete everything that isn't versioned (1.x, 2.x)
21ls | grep -E -v '^\d+\.x$' | xargs rm -rf
Narayan Kamath166772b2013-11-04 16:04:55 +000022
23# Copy website files from real repo
24cp -R ../website/* .
25
Narayan Kamath166772b2013-11-04 16:04:55 +000026# Stage all files in git and create a commit
27git add .
28git add -u
29git commit -m "Website at $(date)"
30
31# Push the new files up to GitHub
32git push origin gh-pages
33
34# Delete our temp folder
35cd ..
36rm -rf $DIR