ansible playbook to set up a laminar container Ci build. moved to: https://git.sindominio.net/sindominio/ansible_laminar
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible_laminar/check_updates

45 lines
933 B

#!/bin/bash -x
image=$1
needs_build=false
if [ -f {{ laminar_home }}/version/${image} ]
then
old_version=`cat {{ laminar_home }}/version/${image}`
version=`{{ laminar_home }}/repos/${image}/version`
if [ "$version" != "$old_version" ]
then
needs_build=true
fi
fi
if [ $needs_build = false ]
then
docker run --entrypoint /bin/bash -u root {{ registry_domain }}/$image -c "apt-get update; apt-get upgrade --assume-no"
if [ $? -eq 1 ]
then
needs_build=true
fi
fi
if [ $needs_build = true ]
then
echo "update ${image}"
if [ "$image" == "debian" ]
then
laminarc queue base_image
else
build_image $image
fi
exit 0
else
echo "check for updates of child images of ${image}"
base="{{ registry_domain }}/$1"
for i in `curl -s -X GET {{ registry }}/v2/_catalog | jq -r '.repositories[]'`
do
if [ ! -z "`grep "FROM ${base}" {{ laminar_home }}/repos/${i}/Dockerfile`" ]
then
check_updates $i
fi
done
fi