Skip to content

Commit

Permalink
Major release_scripts overhaul!
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Reiner committed Apr 29, 2014
1 parent 6d6fb0f commit 6ac8041
Show file tree
Hide file tree
Showing 4 changed files with 407 additions and 261 deletions.
117 changes: 68 additions & 49 deletions release_scripts/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ can be copied to a USB key to be taken to the offline computer.
<outputDir>/BitcoinArmory (clone of repo)
<outputDir>/release_scripts (copy of release_scripts dir from repo)
<outputDir>/installers (all non-offline-bundle packages)
<outputDir>/announceFiles (all unsigned announcement files)
<outputDir>/unsignedannounce (all unsigned announcement files)
<outputDir>/SHA256SUMS.asc (if present)

Note the release_scripts dir is itself copied because it has master_list.py
Expand All @@ -84,17 +84,27 @@ of Armory for any non-generic-python operations.
argv[0] <>
argv[1] inputDir (from Step1)
argv[2] outputDir (for Step3)
argv[3] gpgKeyID
argv[4] btcWltID
argv[5]* git branch to tag (default ~ "master")
argv[3] bundleDir
argv[4] gpgKeyID
argv[5] btcWltID
argv[6]* git branch to tag (default ~ "master")

Script Output:

<outputDir>/BitcoinArmory (same repo but with signed tag v0.91.1)
<outputDir>/release_scripts (same copy, unmodified)
<outputDir>/installers (now includes offline bundles)
<outputDir>/installers (signed, now includes offline bundles)
<outputDir>/announceFiles (all txt signed, added announce.txt)

The "bundleDir" should contain one directory for everything in the master
package list that "hasBundle==True". It's "BundleDeps" will be the name
of the directory that the Step 2 script will look for. The bundle deps dir
will contain all dependencies (all of them .debs, as of this writing), as
well as a script that installs everything including the package itself.
i.e. Step2 script will make a copy of the bundle deps, it will copy the
signed installer into the copy, and then tar it all up. The bundle deps
dir should have, in addition to the deps themselves, a script that will
install everything in that directory including the signed package.



Expand All @@ -110,31 +120,22 @@ It expects to find the .s3cmd configuration file, already setup with your
S3 API key to be able to upload files to the BitoinArmory-releases bucket.
It will do the following:

-- Upload all installers and offline bundles to BitcoinArmory-releases
-- Upload all announce files to BitcoinArmory-media bucket
-- Ask if you'd like to push the latest git tag (if this is a testing
version, you may not want to push the tag)


Script Arguments (* is optional)
argv[0] <>
argv[1] inputDir (from Step2)
argv[5]* git branch to tag (default ~ "master")
argv[2]* isDryRun (default ~ False)

Script Output:

<outputDir>/BitcoinArmory (same repo but with signed tag v0.91.1)
<outputDir>/release_scripts (same copy, unmodified)
<outputDir>/installers (now includes offline bundles)
<outputDir>/announceFiles (all txt signed, added announce.txt)
-- Upload all installers and offline bundles to BitcoinArmory-releases
-- Upload all announce files to BitcoinArmory-media bucket
-- Ask if you'd like to push the latest git tag (if this is a testing
version, you may not want to push the tag)








################################################################################
# #
# Example master_list.py file #
Expand All @@ -152,54 +153,72 @@ def getMasterPackageList():
m[pkg] = {}
m[pkg]['FetchFrom'] = ['cp', '~/windows_share/armory_%s_win32.exe']
m[pkg]['FileSuffix'] = 'winAll.exe'
m[pkg]['OSName'] = 'Windows'
m[pkg]['OSVar'] = 'XP, Vista, 7, 8+'
m[pkg]['OSArch'] = '32- and 64-bit'
m[pkg]['OSNameDisp'] = 'Windows'
m[pkg]['OSVarDisp'] = 'XP, Vista, 7, 8+'
m[pkg]['OSArchDisp'] = '32- and 64-bit'
m[pkg]['OSNameLink'] = 'Windows'
m[pkg]['OSVarLink'] = 'XP,Vista,7,8,8.1'
m[pkg]['OSArchLink'] = '32,64'
m[pkg]['HasBundle'] = False

pkg = 'MacOSX (All)'
m[pkg] = {}
m[pkg]['FetchFrom'] = ['scp', 'joeschmode', '192.168.1.22', 22, '~/BitcoinArmory/osxbuild/armory_%s_osx.tar.gz']
m[pkg]['FileSuffix'] = 'osx.tar.gz'
m[pkg]['OSName'] = 'MacOSX'
m[pkg]['OSVar'] = '10.7+'
m[pkg]['OSArch'] = '64bit'
m[pkg]['OSNameDisp'] = 'MacOSX'
m[pkg]['OSVarDisp'] = '10.7+'
m[pkg]['OSArchDisp'] = '64bit'
m[pkg]['OSNameLink'] = 'MacOSX'
m[pkg]['OSVarLink'] = '10.7,10.8,10.9,10.9.1,10.9.2'
m[pkg]['OSArchLink'] = '64''
m[pkg]['HasBundle'] = False


pkg = 'Ubuntu 12.04-32bit'
m[pkg] = {}
m[pkg]['FetchFrom'] = ['scp', 'guest', '192.168.1.23', 5111, '~/buildenv/armory_%s-1_i386.deb']
m[pkg]['FileSuffix'] = 'ubuntu-32bit.deb'
m[pkg]['OSName'] = 'Ubuntu'
m[pkg]['OSVar'] = '12.04+'
m[pkg]['OSArch'] = '32bit'
m[pkg]['HasBundle'] = True
m[pkg]['BundleDeps'] = 'offline_deps_ubuntu32'
m[pkg]['BndlSuffix'] = 'offline_ubuntu_12.0432.tar.gz'
m[pkg]['FetchFrom'] = ['scp', 'guest', '192.168.1.23', 5111, '~/buildenv/armory_%s-1_i386.deb']
m[pkg]['FileSuffix'] = 'ubuntu-32bit.deb'
m[pkg]['OSNameDisp'] = 'Ubuntu'
m[pkg]['OSVarDisp'] = '12.04+'
m[pkg]['OSArchDisp'] = '32bit'
m[pkg]['OSNameLink'] = 'Ubuntu'
m[pkg]['OSVarLink'] = '12.04,12.10,13.04,13.10,14.04'
m[pkg]['OSArchLink'] = '32'
m[pkg]['HasBundle'] = True
m[pkg]['BundleDeps'] = 'offline_deps_ubuntu32'
m[pkg]['BundleSuffix'] = 'offline_ubuntu_12.0432.tar.gz'
m[pkg]['BundleOSVar'] = '12.04'


pkg = 'Ubuntu 12.04-64bit'
m[pkg] = {}
m[pkg]['FetchFrom'] = ['scp', 'joe', '192.168.1.80', 5111, '~/buildenv/armory_%s-1_amd64_osx.deb']
m[pkg]['FileSuffix'] = 'ubuntu-64bit.deb'
m[pkg]['OSName'] = 'Ubuntu'
m[pkg]['OSVar'] = '12.04+'
m[pkg]['OSArch'] = '64bit'
m[pkg]['HasBundle'] = True
m[pkg]['BundleDeps'] = 'offline_deps_ubuntu64'
m[pkg]['BndlSuffix'] = 'offline_ubuntu64.tar.gz'
m[pkg]['FetchFrom'] = ['scp', 'joe', '192.168.1.80', 5111, '~/buildenv/armory_%s-1_amd64_osx.deb']
m[pkg]['FileSuffix'] = 'ubuntu-64bit.deb'
m[pkg]['OSNameDisp'] = 'Ubuntu'
m[pkg]['OSVarDisp'] = '12.04+'
m[pkg]['OSArchDisp'] = '64bit'
m[pkg]['OSNameLink'] = 'Ubuntu'
m[pkg]['OSVarLink'] = '12.04,12.10,13.04,13.10,14.04'
m[pkg]['OSArchLink'] = '64'
m[pkg]['HasBundle'] = True
m[pkg]['BundleDeps'] = 'offline_deps_ubuntu64'
m[pkg]['BundleSuffix'] = 'offline_ubuntu64.tar.gz'
m[pkg]['BundleOSVar'] = '12.04'

pkg = 'RaspberryPi'
m[pkg] = {}
m[pkg]['FetchFrom'] = ['cp', '~/buildenv/rpibuild/armory_%s-1.tar.gz']
m[pkg]['FileSuffix'] = 'raspbian-armhf.tar.gz'
m[pkg]['OSName'] = 'Raspbian'
m[pkg]['OSVar'] = None
m[pkg]['OSArch'] = 'armhf'
m[pkg]['HasBundle'] = True
m[pkg]['BundleDeps'] = 'offline_deps_raspbian'
m[pkg]['BndlSuffix'] = 'rpi_bundle.tar.gz'
m[pkg]['FetchFrom'] = ['cp', '~/buildenv/rpibuild/armory_%s-1.tar.gz']
m[pkg]['FileSuffix'] = 'raspbian-armhf.tar.gz'
m[pkg]['OSNameDisp'] = 'Raspbian'
m[pkg]['OSVarDisp'] = None
m[pkg]['OSArchDisp'] = 'armhf'
m[pkg]['OSNameLink'] = 'RaspberryPi'
m[pkg]['OSVarLink'] = None
m[pkg]['OSArchLink'] = '32'
m[pkg]['HasBundle'] = True
m[pkg]['BundleDeps'] = 'offline_deps_raspbian'
m[pkg]['BundleSuffix'] = 'rpi_bundle.tar.gz'
m[pkg]['BundleOSVar'] = None


return masterPkgList
Expand Down
37 changes: 22 additions & 15 deletions release_scripts/Step1_Online_PrepareForSigning.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,41 @@
annSrc = argv[4] if len(argv)>5 else './unsignedannounce'
shaCore = argv[5] if len(argv)>6 else None

instDst = os.path.join(outDir, 'installers')
cloneDir = os.path.join(outDir, 'BitcoinArmory')
rscrDir = os.path.join(outDir, 'release_scripts')
annDst = os.path.join(outDir, 'unsignedannounce')

if os.path.exists(outDir):
shutil.rmtree(outDir)
os.mkdir(outDir)
os.makedirs(instDst) # will create outdir and installers dir

# Check that unsigned announcements dir exists
check_exists(annSrc)

# Throw in the Bitcoin Core hashes file if supplied
if shaCore is not None:
check_exists(shaCore)
shutil.copy(shaCore, annDst)
shutil.copy(shaCore, outDir)

# Grab the list of scp and cp commands from fetchlist
for pkgName,pkgDetails in masterPkgList.iteritems():
cmd,cmdArgs = pkgDetails[0],pkgDetails[1:]
for pkgName,pkgInfo in masterPkgList.iteritems():
fetchCmd = pkgInfo['FetchFrom']
cmd,cmdArgs = fetchCmd[0],fetchCmd[1:]
localFn = 'armory_%s%s_%s' % (verStr, verType, pkgInfo['FileSuffix'])
copyTo = os.path.join(instDst, localFn)
if cmd=='cp':
copyFrom = src % verStr
copyTo = os.path.join(outDir, % (verStr, verType))
assert(len(cmdArgs)==1)
copyFrom = cmdArgs[0] % verStr
print 'Copying: %s --> %s' % (copyFrom, copyTo)
shutil.copy(copyFrom, copyTo)
if cmd=='scp':
for usr,ip,port,path,rllist in cplist:
for remoteSrc,localDst in rllist:
remoteSrc = os.path.join(path, remoteSrc % verStr)
hostPath = '%s@%s:%s' % (usr, ip, remoteSrc)
localDst = os.path.join(outDir, localDst % (verStr,verType))
execAndWait(['scp', '-P', str(port), hostPath, localPath])
assert(len(cmdArgs)==4)
usr,ip,port,src = cmdArgs
remoteSrc = src % verStr
hostPath = '%s@%s:%s' % (usr, ip, remoteSrc)
execAndWait(['scp', '-P', str(port), hostPath, copyTo])

cloneDir = os.path.join(outDir, 'BitcoinArmory')
rscrDir = os.path.join(outDir, 'release_scripts')
annDst = os.path.join(outDir, 'unsignedannounce')

execAndWait(['git', 'clone', CLONE_URL, cloneDir])
shutil.copytree('../release_scripts', rscrDir)
Expand Down
Loading

0 comments on commit 6ac8041

Please sign in to comment.