Skip to content

Commit

Permalink
save build image at end
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoamaro committed Apr 26, 2014
1 parent 63c12f5 commit 5b85e42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ And that's it.
```
DRUPALBRANCH="8.x"
DRUPALVERSION=""
IDENTIFIER="BUILD_$(date +%Y_%m_%d_%H%M%S)"
IDENTIFIER="build_$(date +%Y_%m_%d_%H%M%S)" # Only [a-z0-9-_.] allowed
REPODIR="$HOME/testbotdata"
UPDATEREPO="false" # true to force repos update
BUILDSDIR="$REPODIR"
Expand Down
6 changes: 3 additions & 3 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ if [ "$1" = "cleanup" ];
echo "stop and remove testbot containers and images"
echo "---------------------------------------------"
echo
docker ps | grep drupal | awk '{print $1}' | grep -v CONTAINER | xargs -n1 -I {} sudo docker stop {}
docker ps -a | awk '{print $1}' | grep -v CONTAINER | xargs -n1 -I {} sudo docker rm {}
docker images | egrep "testbot|none" | grep -v IMAGE | awk '{print $3}' | xargs -n1 -I {} sudo docker rmi {}
docker ps | egrep "drupal|test" | awk '{print $1}' | grep -v CONTAINER | xargs -n1 -I {} docker stop {}
docker ps -a | awk '{print $1}' | grep -v CONTAINER | xargs -n1 -I {} docker rm {}
docker images | egrep "drupal|testbot|none" | grep -v IMAGE | awk '{print $3}' | xargs -n1 -I {} docker rmi {}
rm -rf ${REPODIR}
fi
set -e
Expand Down
9 changes: 7 additions & 2 deletions distributed/apachephp/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ VERBOSE: Default is 'false'
DBTYPE: Default is 'mysql' from either mysql/sqlite
CMD: Default is none. Normally use '/bin/bash' to debug the container
UPDATEREPO: Force git pull of Drupal & Drush. Default is 'false'
IDENTIFIER: Automated Build Identifier.
IDENTIFIER: Automated Build Identifier. Only [a-z0-9-_.] are allowed
REPODIR: Default is 'HOME/testbotdata'
DRUPALREPO: Default is 'http://git.drupal.org/project/drupal.git'
DRUSHREPO: Default is 'https://github.com/drush-ops/drush.git'
Expand All @@ -67,7 +67,7 @@ fi

# Bellow there is a list of variables that you can override:

IDENTIFIER=${IDENTIFIER:-"BUILD_$(date +%Y_%m_%d_%H%M%S)"}
IDENTIFIER=${IDENTIFIER:-"build_$(date +%Y_%m_%d_%H%M%S)"}
DRUPALBRANCH=${DRUPALBRANCH:-"8.x"}
DRUPALVERSION=${DRUPALVERSION:-"$(echo $DRUPALBRANCH | awk -F. '{print $1}')"}
UPDATEREPO=${UPDATEREPO:-"false"}
Expand Down Expand Up @@ -363,6 +363,11 @@ echo "------------------------- STARTING DOCKER CONTAINER ----------------------

echo "exited $?"

echo "Saving image ${IDENTIFIER}"
docker commit ${IDENTIFIER} drupal/${IDENTIFIER}
# echo "If you need to debug this container run:"
# echo "docker run -d=false -i=true drupal/${IDENTIFIER} /bin/bash"

echo "--------------------------------------------------------------------------------"
echo "Results directory: ${BUILDSDIR}/${IDENTIFIER}/results/"
echo "Make sure to clean up old Builds on ${BUILDSDIR} to save disk space"
Expand Down

0 comments on commit 5b85e42

Please sign in to comment.