Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: releaseAutomation.py

Issue 4702306650030080: Issue 2121 - Release automation fails to put generated packages into the right directory (Closed)
Patch Set: Created March 10, 2015, 7:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« packagerChrome.py ('K') | « packagerSafari.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This Source Code Form is subject to the terms of the Mozilla Public 3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 6
7 import os, re, codecs, subprocess, tarfile, json 7 import os, re, codecs, subprocess, tarfile, json
8 8
9 def get_dependencies(prefix, repos): 9 def get_dependencies(prefix, repos):
10 from ensure_dependencies import read_deps, safe_join 10 from ensure_dependencies import read_deps, safe_join
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 # Now commit the change and tag it 71 # Now commit the change and tag it
72 subprocess.check_call(['hg', 'commit', '-R', baseDir, '-m', 'Releasing %s %s' % (extensionName, version)]) 72 subprocess.check_call(['hg', 'commit', '-R', baseDir, '-m', 'Releasing %s %s' % (extensionName, version)])
73 subprocess.check_call(['hg', 'tag', '-R', baseDir, '-f', version]) 73 subprocess.check_call(['hg', 'tag', '-R', baseDir, '-f', version])
74 74
75 # Create a release build 75 # Create a release build
76 downloads = [] 76 downloads = []
77 if type == "gecko": 77 if type == "gecko":
78 keyFile = keyFiles[0] if keyFiles else None 78 keyFile = keyFiles[0] if keyFiles else None
79 metadata = packager.readMetadata(baseDir, type) 79 metadata = packager.readMetadata(baseDir, type)
80 buildPath = os.path.join(downloadsRepo, packager.getDefaultFileName(baseDir, metadata, version, 'xpi')) 80 buildPath = os.path.join(downloadsRepo, packager.getDefaultFileName(metadata , version, 'xpi'))
81 packager.createBuild(baseDir, type=type, outFile=buildPath, releaseBuild=Tru e, keyFile=keyFile) 81 packager.createBuild(baseDir, type=type, outFile=buildPath, releaseBuild=Tru e, keyFile=keyFile)
82 downloads.append(buildPath) 82 downloads.append(buildPath)
83 elif type == "chrome": 83 elif type == "chrome":
84 # We actually have to create four different builds for Chrome: signed a unsi gned Chrome builds 84 # We actually have to create four different builds for Chrome: signed a unsi gned Chrome builds
85 # (the latter for Chrome Web Store), a signed Opera build and a signed Safar i build. 85 # (the latter for Chrome Web Store), a signed Opera build and a signed Safar i build.
86 metadata = packager.readMetadata(baseDir, type) 86 metadata = packager.readMetadata(baseDir, type)
87 buildPath = os.path.join(downloadsRepo, packager.getDefaultFileName(baseDir, metadata, version, 'crx')) 87 buildPath = os.path.join(downloadsRepo, packager.getDefaultFileName(metadata , version, 'crx'))
88 packager.createBuild(baseDir, type=type, outFile=buildPath, releaseBuild=Tru e, keyFile=keyFiles[0]) 88 packager.createBuild(baseDir, type=type, outFile=buildPath, releaseBuild=Tru e, keyFile=keyFiles[0])
89 downloads.append(buildPath) 89 downloads.append(buildPath)
90 90
91 buildPathUnsigned = os.path.join(baseDir, packager.getDefaultFileName(baseDi r, metadata, version, 'zip')) 91 buildPathUnsigned = os.path.join(baseDir, packager.getDefaultFileName(metada ta, version, 'zip'))
92 packager.createBuild(baseDir, type=type, outFile=buildPathUnsigned, releaseB uild=True, keyFile=None) 92 packager.createBuild(baseDir, type=type, outFile=buildPathUnsigned, releaseB uild=True, keyFile=None)
93 93
94 metadataOpera = packager.readMetadata(baseDir, "opera") 94 metadataOpera = packager.readMetadata(baseDir, "opera")
95 buildPathOpera = os.path.join(downloadsRepo, packager.getDefaultFileName(bas eDir, metadataOpera, version, 'crx')) 95 buildPathOpera = os.path.join(downloadsRepo, packager.getDefaultFileName(met adataOpera, version, 'crx'))
96 packager.createBuild(baseDir, type="opera", outFile=buildPathOpera, releaseB uild=True, keyFile=keyFiles[0]) 96 packager.createBuild(baseDir, type="opera", outFile=buildPathOpera, releaseB uild=True, keyFile=keyFiles[0])
97 downloads.append(buildPathOpera) 97 downloads.append(buildPathOpera)
98 98
99 import buildtools.packagerSafari as packagerSafari 99 import buildtools.packagerSafari as packagerSafari
100 metadataSafari = packagerSafari.readMetadata(baseDir, "safari") 100 metadataSafari = packagerSafari.readMetadata(baseDir, "safari")
101 buildPathSafari = os.path.join(downloadsRepo, packagerSafari.getDefaultFileN ame(baseDir, metadataSafari, version, 'safariextz')) 101 buildPathSafari = os.path.join(downloadsRepo, packagerSafari.getDefaultFileN ame(metadataSafari, version, 'safariextz'))
102 packagerSafari.createBuild(baseDir, type="safari", outFile=buildPathSafari, releaseBuild=True, keyFile=keyFiles[1]) 102 packagerSafari.createBuild(baseDir, type="safari", outFile=buildPathSafari, releaseBuild=True, keyFile=keyFiles[1])
103 downloads.append(buildPathSafari) 103 downloads.append(buildPathSafari)
104 104
105 # Create source archive 105 # Create source archive
106 archivePath = os.path.splitext(buildPath)[0] + '-source.tgz' 106 archivePath = os.path.splitext(buildPath)[0] + '-source.tgz'
107 create_sourcearchive(baseDir, archivePath) 107 create_sourcearchive(baseDir, archivePath)
108 downloads.append(archivePath) 108 downloads.append(archivePath)
109 109
110 # Now add the downloads and commit 110 # Now add the downloads and commit
111 subprocess.check_call(['hg', 'add', '-R', downloadsRepo] + downloads) 111 subprocess.check_call(['hg', 'add', '-R', downloadsRepo] + downloads)
112 subprocess.check_call(['hg', 'commit', '-R', downloadsRepo, '-m', 'Releasing % s %s' % (extensionName, version)]) 112 subprocess.check_call(['hg', 'commit', '-R', downloadsRepo, '-m', 'Releasing % s %s' % (extensionName, version)])
113 113
114 # Push all changes 114 # Push all changes
115 subprocess.check_call(['hg', 'push', '-R', baseDir]) 115 subprocess.check_call(['hg', 'push', '-R', baseDir])
116 subprocess.check_call(['hg', 'push', '-R', downloadsRepo]) 116 subprocess.check_call(['hg', 'push', '-R', downloadsRepo])
OLDNEW
« packagerChrome.py ('K') | « packagerSafari.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld