Skip to content

Instantly share code, notes, and snippets.

@adimania
Last active September 10, 2015 03:06
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 adimania/6965be099904433f626f to your computer and use it in GitHub Desktop.
Save adimania/6965be099904433f626f to your computer and use it in GitHub Desktop.
Testing Fedora-Dockerfiles package
#!/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
@scollier
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment