Graylog2 / fpm-recipes

Graylog package build recipes
http://docs.graylog.org/en/latest/pages/installation/operating_system_packages.html
18 stars 19 forks source link

Add script to update sha256 values in data.yml. #94

Closed malcyon closed 3 years ago

malcyon commented 3 years ago

This is to help the release process automatically update the package sha values.

malcyon commented 3 years ago

Pretty inefficient, opening the file three times. But it's only a small yaml file, so I think it's fine.

malcyon commented 3 years ago

Pyyaml really doesn't want to quote some of these values. It still seems to work, though. Here are the commands I used to test locally:

scripts/update_sha.py --path recipes/data.yml --version-major 3.3 --version 3.3.5  --suffix --revision 1
scripts/update_sha.py --path recipes/data.yml --package-name graylog-server --sha256 2939ebb9005d7589cf07e150f897c9fff5c13a7a50e81f7716fffa041aee7b6a
scripts/update_sha.py --path recipes/data.yml --package-name graylog-enterprise-plugins --sha256 e87919714740a0803a5e9a25924bb94b0327b2c96ccfb1bb0247b616d6220174
scripts/update_sha.py --path recipes/data.yml --package-name graylog-integrations-plugins --sha256 e9c3e4637abb763457b1cfa23ad3a99fa2ec52cbae675e789339f60fa312437a
scripts/update_sha.py --path recipes/data.yml --package-name graylog-enterprise-integrations-plugins --sha256 a41c17859e52630648d338ddc4dc3d041a1963a087e4d5619187f26aa2e850a8

docker run -it -v /home/donald/src/fpm-recipes:/data ef601095f717 /bin/bash -c "cd /data/recipes/graylog-server; fpm-cook"
docker run -it -v /home/donald/src/fpm-recipes:/data ef601095f717 /bin/bash -c "cd /data/recipes/graylog-integrations-plugins; fpm-cook"

scripts/update_sha.py --path recipes/data.yml --version-major 3.3 --version 3.3.0  --suffix=-rc.1 --revision 1.rc.1
scripts/update_sha.py --path recipes/data.yml --package-name graylog-server --sha256 8cebc7267d658ea328fea1f8869749c8be7adfbebf40d79a6730e3e033c49556
scripts/update_sha.py --path recipes/data.yml --package-name graylog-enterprise-plugins --sha256 633846e8a811f1471ead3d38252fdc37a73dea067098e09ee41382462425a4ad
scripts/update_sha.py --path recipes/data.yml --package-name graylog-integrations-plugins --sha256 12159485d432b6f0448780c28589be39ab89f68e671cfc50e7e46bfb28efb45c
scripts/update_sha.py --path recipes/data.yml --package-name graylog-enterprise-integrations-plugins --sha256 84b7ccfbff1184dc5fe39407b0a667d0cb61df9602afe38a1194c9a444c71574

docker run -it -v /home/donald/src/fpm-recipes:/data ef601095f717 /bin/bash -c "cd /data/recipes/graylog-server; fpm-cook"
docker run -it -v /home/donald/src/fpm-recipes:/data ef601095f717 /bin/bash -c "cd /data/recipes/graylog-integrations-plugins; fpm-cook"

Results:

donald@laptop:~/src/fpm-recipes$ docker run -it -v /home/donald/src/fpm-recipes:/data ef601095f717 /bin/bash -c "cd /data/recipes/graylog-integrations-plugins; fpm-cook"
Doing `require 'backports'` is deprecated and will not load any backport in the next major release.
Require just the needed backports instead, or 'backports/latest'.
===> Starting package creation for graylog-integrations-plugins-3.3.5-1 (ubuntu, deb)
===> 
===> Verifying build_depends and depends with Puppet
===> Verifying package: graylog-server (>= 3.3.5-1)
WARNING: Required package 'graylog-server (>= 3.3.5-1)' has a relative version requirement; not attempting to find/install a package to satisfy
===> Missing/wrong version packages: graylog-server (>= 3.3.5-1)
===> Running as root; installing missing/wrong version build_depends and depends with Puppet
===> Installing package: graylog-server (>= 3.3.5-1)
WARNING: Required package 'graylog-server (>= 3.3.5-1)' has a relative version requirement; not attempting to find/install a package to satisfy
===> Fetching source: 
===> Using cached file /data/recipes/graylog-integrations-plugins/cache/graylog-integrations-plugins-3.3.5.tgz
===> Using source directory: /data/recipes/graylog-integrations-plugins/tmp-build/graylog-integrations-plugins-3.3.5
WARNING: Skipping build of graylog-integrations-plugins because build cookie found (/data/recipes/graylog-integrations-plugins/tmp-build/.build-cookie-graylog_integrations_plugins_3_3_5_1), use "fpm-cook clean" to rebuild!
===> Installing into /data/recipes/graylog-integrations-plugins/tmp-dest
===> [FPM] Converting dir to deb {}
===> Removing existing package file: graylog-integrations-plugins_3.3.5-1_all.deb
===> [FPM] Creating boilerplate changelog file {}
===> [FPM] Reading template {"path":"/var/lib/gems/2.3.0/gems/fpm-1.11.0/templates/deb/changelog.erb"}
===> [FPM] No deb_installed_size set, calculating now. {}
===> [FPM] Reading template {"path":"/var/lib/gems/2.3.0/gems/fpm-1.11.0/templates/deb.erb"}
WARNING: [FPM] Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {}
===> [FPM] Creating {"path":"/tmp/package-deb-build-a10839be1328d1f3219d5fb7ce4cc51aa80cc5bd3dee88ea111ab76c399d/control.tar.gz","from":"/tmp/package-deb-build-a10839be1328d1f3219d5fb7ce4cc51aa80cc5bd3dee88ea111ab76c399d/control"}
===> Created package: /data/recipes/graylog-integrations-plugins/pkg/graylog-integrations-plugins_3.3.5-1_all.deb

and:

donald@laptop:~/src/fpm-recipes$ docker run -it -v /home/donald/src/fpm-recipes:/data ef601095f717 /bin/bash -c "cd /data/recipes/graylog-server; fpm-cook"
Doing `require 'backports'` is deprecated and will not load any backport in the next major release.
Require just the needed backports instead, or 'backports/latest'.
===> Starting package creation for graylog-server-3.3.0-1.rc.1 (ubuntu, deb)
===> 
===> Verifying build_depends and depends with Puppet
===> Verifying package: uuid-runtime
===> All build_depends and depends packages installed
===> Fetching source: 
===> Using cached file /data/recipes/graylog-server/cache/graylog-3.3.0-rc.1.tgz
===> Using source directory: /data/recipes/graylog-server/tmp-build/graylog-3.3.0-rc.1
WARNING: Skipping build of graylog-server because build cookie found (/data/recipes/graylog-server/tmp-build/.build-cookie-graylog_server_3_3_0_1_rc_1), use "fpm-cook clean" to rebuild!
===> Installing into /data/recipes/graylog-server/tmp-dest
===> [FPM] Converting dir to deb {}
===> Removing existing package file: graylog-server_3.3.0-1.rc.1_all.deb
===> [FPM] Creating boilerplate changelog file {}
===> [FPM] Reading template {"path":"/var/lib/gems/2.3.0/gems/fpm-1.11.0/templates/deb/changelog.erb"}
===> [FPM] No deb_installed_size set, calculating now. {}
===> [FPM] Reading template {"path":"/var/lib/gems/2.3.0/gems/fpm-1.11.0/templates/deb.erb"}
WARNING: [FPM] Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {}
===> [FPM] Creating {"path":"/tmp/package-deb-build-87d35d30fbbce05e754b2829a6f0137edf679b5f5af1bdbb3415ad018c8e/control.tar.gz","from":"/tmp/package-deb-build-87d35d30fbbce05e754b2829a6f0137edf679b5f5af1bdbb3415ad018c8e/control"}
===> Created package: /data/recipes/graylog-server/pkg/graylog-server_3.3.0-1.rc.1_all.deb
donald@laptop:~/src/fpm-recipes$ docker run -it -v /home/donald/src/fpm-recipes:/data ef601095f717 /bin/bash -c "cd /data/recipes/graylog-integrations-plugins; fpm-cook"
Doing `require 'backports'` is deprecated and will not load any backport in the next major release.
Require just the needed backports instead, or 'backports/latest'.
===> Starting package creation for graylog-integrations-plugins-3.3.0-1.rc.1 (ubuntu, deb)
===> 
===> Verifying build_depends and depends with Puppet
===> Verifying package: graylog-server (>= 3.3.0-1.rc.1)
WARNING: Required package 'graylog-server (>= 3.3.0-1.rc.1)' has a relative version requirement; not attempting to find/install a package to satisfy
===> Missing/wrong version packages: graylog-server (>= 3.3.0-1.rc.1)
===> Running as root; installing missing/wrong version build_depends and depends with Puppet
===> Installing package: graylog-server (>= 3.3.0-1.rc.1)
WARNING: Required package 'graylog-server (>= 3.3.0-1.rc.1)' has a relative version requirement; not attempting to find/install a package to satisfy
===> Fetching source: 
######################################################################## 100.0%
===> Using source directory: /data/recipes/graylog-integrations-plugins/tmp-build/graylog-integrations-plugins-3.3.0-rc.1
===> Building in /data/recipes/graylog-integrations-plugins/tmp-build/graylog-integrations-plugins-3.3.0-rc.1
===> Installing into /data/recipes/graylog-integrations-plugins/tmp-dest
===> [FPM] Converting dir to deb {}
===> [FPM] Creating boilerplate changelog file {}
===> [FPM] Reading template {"path":"/var/lib/gems/2.3.0/gems/fpm-1.11.0/templates/deb/changelog.erb"}
===> [FPM] No deb_installed_size set, calculating now. {}
===> [FPM] Reading template {"path":"/var/lib/gems/2.3.0/gems/fpm-1.11.0/templates/deb.erb"}
WARNING: [FPM] Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {}
===> [FPM] Creating {"path":"/tmp/package-deb-build-26a180da397ad79e8eebbb70ed163553676c1be0720768393316ee0f6dec/control.tar.gz","from":"/tmp/package-deb-build-26a180da397ad79e8eebbb70ed163553676c1be0720768393316ee0f6dec/control"}
===> Created package: /data/recipes/graylog-integrations-plugins/pkg/graylog-integrations-plugins_3.3.0-1.rc.1_all.deb