Browse Source

Check versions of upstream software

master
meskio 1 year ago
parent
commit
050d7176cc
Signed by: meskio
GPG Key ID: 52B8F5AC97A2DA86
  1. 5
      build_image.run
  2. 43
      check_updates
  3. 8
      playbook.yml

5
build_image.run

@ -17,4 +17,9 @@ docker tag ${image} {{ registry_domain }}/${image}
docker tag ${image} {{ registry }}/${image}
docker push {{ registry }}/${image}
if [ -f ./version ]
then
./version > {{ laminar_home }}/version/${image}
fi
update_images ${image}

43
check_updates

@ -2,8 +2,27 @@
image=$1
docker run --entrypoint /bin/bash -u root {{ registry_domain }}/$image -c "apt-get update; apt-get upgrade --assume-no"
if [ $? -eq 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" ]
@ -13,14 +32,14 @@ then
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
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

8
playbook.yml

@ -125,6 +125,14 @@
group: laminar
mode: u=rwx,g=rx,o=rx
- name: create the version folder for laminar jobs
file:
path: "{{ laminar_home }}/version"
state: directory
owner: laminar
group: laminar
mode: u=rwx,g=rx,o=rx
- name: configure laminar scripts
template:
src: "{{ item }}"

Loading…
Cancel
Save