From aa3ec15dc44eb50c04fe626648e463397c18d310 Mon Sep 17 00:00:00 2001 From: Greg Szabo Date: Tue, 13 Jun 2017 17:01:05 +0000 Subject: [PATCH] Added option to publish new packages to S3 and create Yum repository --- devops/rpmbuild/Makefile | 25 ++++++++++++++++----- devops/rpmbuild/RPM-GPG-KEY-Tendermint | 19 ++++++++++++++++ devops/rpmbuild/spectemplates/basecoin.spec | 6 ++--- devops/rpmbuild/tendermint-dev.repo | 12 ++++++++++ devops/rpmbuild/tendermint.repo | 12 ++++++++++ 5 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 devops/rpmbuild/RPM-GPG-KEY-Tendermint create mode 100644 devops/rpmbuild/tendermint-dev.repo create mode 100644 devops/rpmbuild/tendermint.repo diff --git a/devops/rpmbuild/Makefile b/devops/rpmbuild/Makefile index 1e0d45508..0661fbbfa 100644 --- a/devops/rpmbuild/Makefile +++ b/devops/rpmbuild/Makefile @@ -31,12 +31,12 @@ endif binaries = tendermint basecoin ethermint build-binaries = build-tendermint build-basecoin build-ethermint -dist-binaries = dist-tendermint dist-basecoin dist-ethermint +package-binaries = package-tendermint package-basecoin package-ethermint all: $(binaries) build: $(build-binaries) -dist: $(dist-binaries) -$(binaries): %: build-% dist-% ; +package: $(package-binaries) +$(binaries): %: build-% package-% ; ### # Building the binaries is not in the spec file, because in the spec file you already need to know the version number @@ -68,18 +68,31 @@ prepare-spec-%: $(GOPATH)/bin/% echo "Release: $(BUILD_NUMBER)" >> SPECS/$*.spec cat spectemplates/$*.spec >> SPECS/$*.spec -dist-tendermint: prepare-spec-tendermint +package-tendermint: prepare-spec-tendermint $(info Packaging tendermint version $(tendermint_version)) rpmbuild -bb SPECS/tendermint.spec --sign -dist-basecoin: prepare-spec-basecoin +package-basecoin: prepare-spec-basecoin $(info Packaging basecoin version $(basecoin_version)) rpmbuild -bb SPECS/basecoin.spec --sign -dist-ethermint: prepare-spec-ethermint ; +package-ethermint: prepare-spec-ethermint ; $(info Packaging ethermint version $(ethermint_version)) rpmbuild -bb SPECS/ethermint.spec --sign +install-%: +#Make sure your host has the IAM role to read/write the S3 bucket OR that you set up ~/.boto + aws s3 sync s3://tendermint-packages/centos/ tmp/s3/ + mkdir -p tmp/s3/7/cr/x86_64/Packages + cp -r RPMS/x86_64/$** tmp/s3/7/cr/x86_64/Packages + cp ./RPM-GPG-KEY-Tendermint tmp/s3/7/os/x86_64/ + cp ./tendermint.repo tmp/s3/7/os/x86_64/ + cp ./tendermint-dev.repo tmp/s3/7/cr/x86_64/ + createrepo tmp/s3/7/cr/x86_64/Packages -u http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/cr/x86_64/Packages -o tmp/s3/7/cr/x86_64 --update -S --repo Tendermint --content tendermint --content basecoin --content ethermint + #Asks about overwrite + gpg --clearsign tmp/s3/7/cr/x86_64/repodata/repomd.xml + aws s3 sync tmp/s3/ s3://tendermint-packages/centos/ --acl public-read + mostlyclean: rm -rf {BUILDROOT,SOURCES,SPECS,SRPMS,tmp} diff --git a/devops/rpmbuild/RPM-GPG-KEY-Tendermint b/devops/rpmbuild/RPM-GPG-KEY-Tendermint new file mode 100644 index 000000000..e6f200d87 --- /dev/null +++ b/devops/rpmbuild/RPM-GPG-KEY-Tendermint @@ -0,0 +1,19 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQENBFk97ngBCADaiPQFKJI7zWYdUKqC490DzY9g9LatsWoJErK5LuMXwEnF5i+a +UkygueukA4C5U7L71l5EeOB9rtb6AbkF4IEZsmmp93APec/3Vfbac9xvK4dBdiht +F8SrazPdHeR6AKcZH8ZpG/+mdONvGb/gEgtxVjaeIJFpCbjKLlKEXazh2zamhhth +q+Nn/17QmI3KBiaGqQK5w4kGZ4mZPy6fXMQhW5dDMq9f4anlGIAYi9O53dVxsx2S +5d+NHuGer5Ps0u6WMJi/e+UT2EGwzP6ygOxkIjyhMFuVftabOtSSrRHHetw8UAaI +N/RPn2gSbQtOQ7unzHDXp3/o6/r2nDEErPyJABEBAAG0LkdyZWcgU3phYm8gKFRl +bmRlcm1pbnQpIDxncmVnQHBoaWxvc29iZWFyLmNvbT6JATkEEwECACMFAlk97ngC +GwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRDIkIHIISLL6bX/CACXTKmO +u5XgvJICH0pHNeVS5/4Om1Rsg1xNmEkGFBP8N2fqn576exbOLgWLSyNHTEyrJNoc +iTeUtod2qqbVGwRgWm1zeiP8NBYiQ9SUbqskIqcPavJNGWIxsCB0p/odoZah8xSj +tGrkoyoxrc+7z2JgKYK8SVSkJXQkzuc5/ZlY85ci5gPKQhlo5YDqGo+4U9n/Ieo5 +nkF8LBalFC2j7A7sQNroEicpulpGhIq3jyUHtadX01z3pNzuX+wfHX9futoet0YS +tG2007WoPGV0whGnoKxmk0JhwzhscC2XNtJl1GZcwqOOlPU9eGtZuPKj/HBAlRtz +4xTOAcklpg8soqRA +=jNDW +-----END PGP PUBLIC KEY BLOCK----- diff --git a/devops/rpmbuild/spectemplates/basecoin.spec b/devops/rpmbuild/spectemplates/basecoin.spec index 57ef465cf..14965a418 100644 --- a/devops/rpmbuild/spectemplates/basecoin.spec +++ b/devops/rpmbuild/spectemplates/basecoin.spec @@ -58,17 +58,17 @@ EOF # This is a TOML config file. # For more information, see https://github.com/toml-lang/toml -proxy_app = "tcp://127.0.0.1:46658" +proxy_app = "tcp://127.0.0.1:36658" moniker = "" fast_sync = true db_backend = "leveldb" log_level = "debug" [rpc] -laddr = "tcp://0.0.0.0:46657" +laddr = "tcp://0.0.0.0:36657" [p2p] -laddr = "tcp://0.0.0.0:46656" +laddr = "tcp://0.0.0.0:36656" seeds = "" EOF %{__cat} << EOF > .%{_sysconfdir}/systemd/system/%{name}.service diff --git a/devops/rpmbuild/tendermint-dev.repo b/devops/rpmbuild/tendermint-dev.repo new file mode 100644 index 000000000..c34a7b59a --- /dev/null +++ b/devops/rpmbuild/tendermint-dev.repo @@ -0,0 +1,12 @@ +#This is the .repo file for the Tendermint CentOS repositories. +#Although it has only been tested under CentOS 7, it should work under Fedora and RedHat 7 too. +#Currently only 64-bit packages are built. + +[tendermint-dev] +name=Tendermint development releases repository +baseurl=http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/cr/x86_64 +gpgcheck=1 +gpgkey=http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/os/x86_64/RPM-GPG-KEY-Tendermint +enabled=1 +#sslverify = 1 + diff --git a/devops/rpmbuild/tendermint.repo b/devops/rpmbuild/tendermint.repo new file mode 100644 index 000000000..efaa7274c --- /dev/null +++ b/devops/rpmbuild/tendermint.repo @@ -0,0 +1,12 @@ +#This is the .repo file for the Tendermint CentOS repositories. +#Although it has only been tested under CentOS 7, it should work under Fedora and RedHat 7 too. +#Currently only 64-bit packages are built. + +[tendermint] +name=Tendermint stable releases repository +baseurl=http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/os/x86_64 +gpgcheck=1 +gpgkey=http://tendermint-packages.s3-website-us-west-1.amazonaws.com/centos/7/os/x86_64/RPM-GPG-KEY-Tendermint +enabled=1 +#sslverify = 1 +