Chef: получить checksum

Автор: | 07/26/2016
 

pic-chef-logoВ рецепте имеется указание на файл Maven для установки на билд-агент GoCD по время его провижена:

...
                        },
                        "3.3.3": {
                            "url": "http://apache.ip-connect.vn.ua/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz",
                            "checksum": "3a8dc4a12ab9f3607a1a2097bbab0150c947ad6719d8f1bb6d5b47d0fb0c4779"
                        }
...

Требуется обновить его до 3.3.9, который находится тут: http://apache.ip-connect.vn.ua/maven/maven-3/3.3.9/binaries.

Загружаем файл на машину, и используем shasum для получения контрольной суммы нового файла:

$ shasum -a 256 ~/Temp/apache-maven-3.3.9-bin.tar.gz
6e3e9c949ab4695a204f74038717aa7b2689b1be94875899ac1b3fe42800ff82  /home/setevoy/Temp/apache-maven-3.3.9-bin.tar.gz

Обновляем запись:

...
                        "3.3.3": {
                            "url": "http://apache.ip-connect.vn.ua/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz",
                            "checksum": "6e3e9c949ab4695a204f74038717aa7b2689b1be94875899ac1b3fe42800ff82"
                        }
...

Готово:

...
01:15:42.566          * alternatives_package[install maven http://apache.mirrors.tds.net/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz] action install (up to date)
01:15:42.588          * ark[maven-3.3.9] action put
01:15:42.604            * directory[/opt/alternatives/maven-3.3.9] action create
01:15:42.608              - create new directory /opt/alternatives/maven-3.3.9
01:15:55.759            * remote_file[/tmp/kitchen/cache/maven-3.3.9.tar.gz] action create
01:15:56.333              - create new file /tmp/kitchen/cache/maven-3.3.9.tar.gz
01:15:56.337              - update content in file /tmp/kitchen/cache/maven-3.3.9.tar.gz from none to 6e3e9c
01:15:56.339              (new content is binary, diff output suppressed)
01:15:56.346            * execute[unpack /tmp/kitchen/cache/maven-3.3.9.tar.gz] action nothing (skipped due to action :nothing)
01:15:56.347            * execute[set owner on /opt/alternatives/maven-3.3.9] action nothing (skipped due to action :nothing)
01:15:56.958            * execute[unpack /tmp/kitchen/cache/maven-3.3.9.tar.gz] action run
01:15:56.958              - execute /bin/tar xzf /tmp/kitchen/cache/maven-3.3.9.tar.gz --strip-components=1
01:15:57.034            * execute[set owner on /opt/alternatives/maven-3.3.9] action run
01:15:57.035              - execute chown -R root:0 /opt/alternatives/maven-3.3.9
...