[deb] publish deb package

Signed-off-by: Leo Chen <leo@harmony.one>
pull/3313/head
Leo Chen 4 years ago
parent 57343d8e0e
commit b32c489ab3
  1. 18
      Makefile
  2. 30
      scripts/package/deb/build.sh
  3. 42
      scripts/package/deb/dev.aptly.conf
  4. 42
      scripts/package/deb/prod.aptly.conf
  5. 11
      scripts/package/publish-repo.sh

@ -6,12 +6,12 @@ export LIBRARY_PATH:=$(LD_LIBRARY_PATH)
export DYLD_FALLBACK_LIBRARY_PATH:=$(LD_LIBRARY_PATH) export DYLD_FALLBACK_LIBRARY_PATH:=$(LD_LIBRARY_PATH)
export GO111MODULE:=on export GO111MODULE:=on
PKGNAME=harmony PKGNAME=harmony
VERSION?=2.3.5 VERSION?=2.3.6
RPMBUILD=$(HOME)/rpmbuild RPMBUILD=$(HOME)/rpmbuild
DEBBUILD=$(HOME)/debbuild DEBBUILD=$(HOME)/debbuild
SHELL := bash SHELL := bash
.PHONY: all help libs exe race trace-pointer debug debug-kill test test-go test-api test-api-attach linux_static deb rpm_init rpm_build rpm .PHONY: all help libs exe race trace-pointer debug debug-kill test test-go test-api test-api-attach linux_static deb_init deb_build deb debpub_dev debpub_prod rpm_init rpm_build rpm rpmpub_dev rpmpub_prod
all: libs all: libs
bash ./scripts/go_executable_build.sh -S bash ./scripts/go_executable_build.sh -S
@ -32,7 +32,7 @@ help:
@echo "linux_static - static build the harmony binary & bootnode along with the MCL & BLS libs (for linux)" @echo "linux_static - static build the harmony binary & bootnode along with the MCL & BLS libs (for linux)"
@echo "arm_static - static build the harmony binary & bootnode on ARM64 platform" @echo "arm_static - static build the harmony binary & bootnode on ARM64 platform"
@echo "rpm - build a harmony RPM pacakge" @echo "rpm - build a harmony RPM pacakge"
@echo "deb - build a harmony Debian pacakge (todo)" @echo "deb - build a harmony Debian pacakge"
libs: libs:
make -C $(TOP)/mcl -j8 make -C $(TOP)/mcl -j8
@ -104,6 +104,14 @@ deb_build:
deb: deb_init deb_build deb: deb_init deb_build
debpub_dev: deb
cp scripts/package/deb/dev.aptly.conf ~/.aptly.conf
./scripts/package/publish-repo.sh -p dev -n deb -s $(DEBBUILD)
debpub_prod: deb
cp scripts/package/deb/prod.aptly.conf ~/.aptly.conf
./scripts/package/publish-repo.sh -p prod -n deb -s $(DEBBUILD)
rpm_init: rpm_init:
rm -rf $(RPMBUILD) rm -rf $(RPMBUILD)
mkdir -p $(RPMBUILD)/{SOURCES,SPECS,BUILD,RPMS,BUILDROOT,SRPMS} mkdir -p $(RPMBUILD)/{SOURCES,SPECS,BUILD,RPMS,BUILDROOT,SRPMS}
@ -125,7 +133,7 @@ rpm: rpm_init rpm_build
rpm --addsign $(RPMBUILD)/RPMS/x86_64/$(PKGNAME)-$(VERSION)-0.x86_64.rpm rpm --addsign $(RPMBUILD)/RPMS/x86_64/$(PKGNAME)-$(VERSION)-0.x86_64.rpm
rpmpub_dev: rpm rpmpub_dev: rpm
./scripts/package/publish-repo.sh -p dev -t rpm -s $(RPMBUILD) ./scripts/package/publish-repo.sh -p dev -n rpm -s $(RPMBUILD)
rpmpub_prod: rpm rpmpub_prod: rpm
./scripts/package/publish-repo.sh -p prod -t rpm -s $(RPMBUILD) ./scripts/package/publish-repo.sh -p prod -n rpm -s $(RPMBUILD)

@ -1,30 +0,0 @@
#!/bin/bash
if [ $# != 1 ]; then
echo "$0 version"
exit
fi
VERSION=$1
fpm -s dir -t deb -n harmony -p harmony_VERSION_ARCH.deb -C harmony-${VERSION} \
-v "$VERSION" \
--license "MIT" \
--vendor "Harmony Blockchain" \
--category "net" \
--no-depends \
--no-auto-depends \
--directories /etc/harmony \
--directories /data/harmony \
--architecture x86_64 \
--maintainer "Leo Chen <leo@harmony.one>" \
--description "Harmony is a sharded, fast finality, low fee, PoS public blockchain.\nThis package contains the validator node program for harmony blockchain." \
--url "https://harmony.one" \
--before-install scripts/preinst \
--after-install scripts/postinst \
--before-remove scripts/prerm \
--after-remove scripts/postrm \
--before-upgrade scripts/preup \
--after-upgrade scripts/postup \
--deb-changelog scripts/changelog \
--deb-systemd-restart-after-upgrade

@ -0,0 +1,42 @@
{
"rootDir": "/tmp/.aptly",
"downloadConcurrency": 4,
"downloadSpeedLimit": 0,
"architectures": [],
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"dependencyVerboseResolve": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
"gpgProvider": "gpg",
"downloadSourcePackages": false,
"skipLegacyPool": true,
"ppaDistributorID": "ubuntu",
"ppaCodename": "",
"FileSystemPublishEndpoints": {
"harmony-dev": {
"rootDir": "/tmp/repo",
"linkMethod": "copy",
"verifyMethod": "md5"
}
},
"S3PublishEndpoints": {
"harmony-dev": {
"region": "us-east-1",
"bucket": "haochen-harmony-pub",
"endpoint": "",
"awsAccessKeyID": "",
"awsSecretAccessKey": "",
"prefix": "pub/repo",
"acl": "public-read",
"storageClass": "",
"encryptionMethod": "",
"plusWorkaround": false,
"disableMultiDel": false,
"forceSigV2": false,
"debug": false
}
}
}

@ -0,0 +1,42 @@
{
"rootDir": "/tmp/.aptly",
"downloadConcurrency": 4,
"downloadSpeedLimit": 0,
"architectures": [],
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"dependencyVerboseResolve": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
"gpgProvider": "gpg",
"downloadSourcePackages": false,
"skipLegacyPool": true,
"ppaDistributorID": "ubuntu",
"ppaCodename": "",
"FileSystemPublishEndpoints": {
"harmony-prod": {
"rootDir": "/tmp/repo",
"linkMethod": "copy",
"verifyMethod": "md5"
}
},
"S3PublishEndpoints": {
"harmony-prod": {
"region": "us-west-1",
"bucket": "pub.harmony.one",
"endpoint": "",
"awsAccessKeyID": "",
"awsSecretAccessKey": "",
"prefix": "release/package/apt",
"acl": "public-read",
"storageClass": "",
"encryptionMethod": "",
"plusWorkaround": false,
"disableMultiDel": false,
"forceSigV2": false,
"debug": false
}
}
}

@ -69,7 +69,16 @@ function publish_rpm() {
} }
function publish_deb() { function publish_deb() {
: if aptly repo show harmony-$PROFILE > /dev/null; then
aptly repo add harmony-$PROFILE $SRC
aptly publish update bionic s3:harmony-$PROFILE:
else
aptly repo create -distribution=bionic -component=main harmony-$PROFILE
aptly repo add harmony-$PROFILE $SRC
aptly publish repo harmony-$PROFILE s3:harmony-$PROFILE:
fi
# remove the local repo
aptly repo drop harmony-$PROFILE
} }
################## MAIN ################## ################## MAIN ##################

Loading…
Cancel
Save