-
-
Save inthecloud247/aa368e2f3e0d3da46454 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
archive=$1 | |
if [ -z "$archive" ]; then | |
echo "No archive provided." | |
echo "Usage: $0 archive.tar" | |
exit | |
fi | |
if [ -e "$archive" ]; then | |
echo "File $archive already exists. Please choose another name" | |
exit | |
fi | |
local=`pwd` | |
echo "Backing up to $archive" | |
echo "Exporting data current rdata container" | |
docker rm backup | |
docker run --name backup --volumes-from rdata -v $local:/backup busybox tar cvf /backup/$archive var/jenkins_home nexus | |
docker rm backup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
archive=$1 | |
if [ -z "$archive" ]; then | |
echo "No archive provided." | |
echo "Usage: $0 archive.tar" | |
exit | |
fi | |
echo "Loading from $archive" | |
# Clean up any old stuff here | |
docker rm rdata | |
# Start new data container | |
echo "Starting new rdata container" | |
docker run -d --name rdata -v /var/jenkins_home -v /nexus busybox true | |
# Copy in files from old data container | |
echo "Restoring old files into new rdata" | |
docker rm restore | |
docker run --name restore --volumes-from rdata -v $(pwd):/backup busybox tar xvf /backup/$archive | |
docker rm restore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
now=`date +%s` | |
arch="backup.$now.tar" | |
./backup.sh $arch | |
./load.sh $arch | |
rm $arch | |
./start.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
archive=$1 | |
if [ -z "$archive" ]; then | |
echo "No archive provided." | |
echo "Usage: $0 archive.tar" | |
exit | |
fi | |
echo "Restoring from $archive" | |
./load.sh $archive | |
./start.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Start nexus | |
docker stop nexus | |
docker rm nexus | |
docker run -d --name nexus --volumes-from rdata -p 8081:8081 conceptnotfound/sonatype-nexus | |
# Start jenkins | |
docker stop jenkins | |
docker rm jenkins | |
docker run -d --name jenkins --volumes-from rdata --link nexus:nexus -p 8080:8080 -u root jenkins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment