Last active
September 10, 2015 03:06
-
-
Save adimania/6965be099904433f626f to your computer and use it in GitHub Desktop.
Testing Fedora-Dockerfiles package
This file contains 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 | |
# You can change the url below if you are going to test a fork. | |
git clone https://github.com/fedora-cloud/Fedora-Dockerfiles.git | |
cd Fedora-Dockerfiles | |
# if you are running against a particular branch then uncomment the line below and write the branch name. | |
# git checkout <branch_name> | |
mkdir logs | |
dfiles_dir=$(pwd) | |
for dockerfile in $(find . -name Dockerfile) | |
do | |
echo dockerfile $dockerfile | |
task=$(echo $dockerfile | awk -F '/' '{print $2}') | |
echo ============= starting task $task ================= | |
cd ${dockerfile::-10} | |
docker build --rm -f $dfiles_dir/$dockerfile . >> $dfiles_dir/logs/$task 2>&1 | |
cd - | |
tail -n1 logs/$task | grep 'Successfully built' | |
status=$(echo $?) | |
if [ $status -ne 0 ] | |
then | |
echo $task failed to build | |
else | |
echo $task built. Cleaning up.. | |
docker rmi -f $(tail -n1 logs/$task | awk '{print $NF}') | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I really like this script. I think we should either include it in Fedora-Dockerfiles, or at the very least, in the README, like the CentOS project does here: https://github.com/centos/centos-Dockerfiles