Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@georgerussellpruitt
Last active January 22, 2019 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save georgerussellpruitt/4d89e6bbb96205a60239a3929a525e80 to your computer and use it in GitHub Desktop.
Save georgerussellpruitt/4d89e6bbb96205a60239a3929a525e80 to your computer and use it in GitHub Desktop.
#!/bin/bash
# this is the first script to execute which performs
# checks that everything is installed and operating as expected
$INSTALLED="/var/git/WordPress"
$DIRECTORY="/var/git/"
# install aws command line utility
apt install -y awscli
if [ -d "$INSTALLED" ];
then
# directory existed do pull
# change to dir
cd $INSTALLED
# Get new tags from the remote and checkout latest tag
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
else
# directory didnt exist do clone
cd $DIRECTORY
# Grab wordpress
git clone https://github.com/WordPress/WordPress.git
cd WordPress/
# Get new tags from the remote and checkout latest tag
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
cd $DIRECTORY
#checkout ket umbrella/stack repository
git clone https://bitbucket.org/ket-dev/prime-stack.git --recursive
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment