Ejemplo n.º 1
0
	def release_without_0repo(archive_file, new_impls_feed):
		assert options.master_feed_file

		if not options.archive_dir_public_url:
			raise SafeException("Archive directory public URL is not set! Edit configuration and try again.")

		if status.updated_master_feed:
			print "Already added to master feed. Not changing."
		else:
			publish_opts = {}
			if os.path.exists(options.master_feed_file):
				# Check we haven't already released this version
				master = support.load_feed(os.path.realpath(options.master_feed_file))
				existing_releases = [impl for impl in master.implementations.values() if impl.get_version() == status.release_version]
				if len(existing_releases):
					raise SafeException("Master feed %s already contains an implementation with version number %s!" % (options.master_feed_file, status.release_version))

				previous_release = get_previous_release(status.release_version)
				previous_testing_releases = [impl for impl in master.implementations.values() if impl.get_version() == previous_release
													     and impl.upstream_stability == model.stability_levels["testing"]]
				if previous_testing_releases:
					print "The previous release, version %s, is still marked as 'testing'. Set to stable?" % previous_release
					if support.get_choice(['Yes', 'No']) == 'Yes':
						publish_opts['select_version'] = previous_release
						publish_opts['set_stability'] = "stable"

			support.publish(options.master_feed_file, local = new_impls_feed, xmlsign = True, key = options.key, **publish_opts)

			status.updated_master_feed = 'true'
			status.save()

		# Copy files...
		uploads = [os.path.basename(archive_file)]
		for b in compiler.get_binary_feeds():
			binary_feed = support.load_feed(b)
			impl, = binary_feed.implementations.values()
			uploads.append(os.path.basename(impl.download_sources[0].url))

		upload_archives(options, status, uploads)

		feed_base = os.path.dirname(list(local_feed.feed_for)[0])
		feed_files = [options.master_feed_file]
		print "Upload %s into %s" % (', '.join(feed_files), feed_base)
		cmd = options.master_feed_upload_command.strip()
		if cmd:
			support.show_and_run(cmd, feed_files)
		else:
			print "NOTE: No feed upload command set => you'll have to upload them yourself!"
Ejemplo n.º 2
0
	def release_without_0repo(archive_file, new_impls_feed):
		assert options.master_feed_file

		if not options.archive_dir_public_url:
			raise SafeException("Archive directory public URL is not set! Edit configuration and try again.")

		if status.updated_master_feed:
			print "Already added to master feed. Not changing."
		else:
			publish_opts = {}
			if os.path.exists(options.master_feed_file):
				# Check we haven't already released this version
				master = support.load_feed(os.path.realpath(options.master_feed_file))
				existing_releases = [impl for impl in master.implementations.values() if impl.get_version() == status.release_version]
				if len(existing_releases):
					raise SafeException("Master feed %s already contains an implementation with version number %s!" % (options.master_feed_file, status.release_version))

				previous_release = get_previous_release(status.release_version)
				previous_testing_releases = [impl for impl in master.implementations.values() if impl.get_version() == previous_release
													     and impl.upstream_stability == model.stability_levels["testing"]]
				if previous_testing_releases:
					print "The previous release, version %s, is still marked as 'testing'. Set to stable?" % previous_release
					if support.get_choice(['Yes', 'No']) == 'Yes':
						publish_opts['select_version'] = previous_release
						publish_opts['set_stability'] = "stable"

			support.publish(options.master_feed_file, local = new_impls_feed, xmlsign = True, key = options.key, **publish_opts)

			status.updated_master_feed = 'true'
			status.save()

		# Copy files...
		uploads = [os.path.basename(archive_file)]
		for b in compiler.get_binary_feeds():
			binary_feed = support.load_feed(b)
			impl, = binary_feed.implementations.values()
			uploads.append(os.path.basename(impl.download_sources[0].url))

		upload_archives(options, status, uploads)

		feed_base = os.path.dirname(list(local_feed.feed_for)[0])
		feed_files = [options.master_feed_file]
		print "Upload %s into %s" % (', '.join(feed_files), feed_base)
		cmd = options.master_feed_upload_command.strip()
		if cmd:
			support.show_and_run(cmd, feed_files)
		else:
			print "NOTE: No feed upload command set => you'll have to upload them yourself!"
Ejemplo n.º 3
0
	else:
		print "\nCandidate release archive:", archive_file
		print "(extracted to %s for inspection)" % os.path.abspath(archive_name)

		print "\nPlease check candidate and select an action:"
		print "P) Publish candidate (accept)"
		print "F) Fail candidate (delete release-status file)"
		if previous_release:
			print "D) Diff against release archive for %s" % previous_release
			maybe_diff = ['Diff']
		else:
			maybe_diff = []
		print "(you can also hit CTRL-C and resume this script when done)"

		while True:
			choice = support.get_choice(['Publish', 'Fail'] + maybe_diff)
			if choice == 'Diff':
				previous_archive_name = support.make_archive_name(local_feed.get_name(), previous_release)
				previous_archive_file = '..' + os.sep + previous_release + os.sep + previous_archive_name + '.tar.bz2'

				# For archives created by older versions of 0release
				if not os.path.isfile(previous_archive_file):
					old_previous_archive_file = '..' + os.sep + previous_archive_name + '.tar.bz2'
					if os.path.isfile(old_previous_archive_file):
						previous_archive_file = old_previous_archive_file

				if os.path.isfile(previous_archive_file):
					support.unpack_tarball(previous_archive_file)
					try:
						support.show_diff(previous_archive_name, archive_name)
					finally:
Ejemplo n.º 4
0
	else:
		print "\nCandidate release archive:", archive_file
		print "(extracted to %s for inspection)" % os.path.abspath(archive_name)

		print "\nPlease check candidate and select an action:"
		print "P) Publish candidate (accept)"
		print "F) Fail candidate (delete release-status file)"
		if previous_release:
			print "D) Diff against release archive for %s" % previous_release
			maybe_diff = ['Diff']
		else:
			maybe_diff = []
		print "(you can also hit CTRL-C and resume this script when done)"

		while True:
			choice = support.get_choice(['Publish', 'Fail'] + maybe_diff)
			if choice == 'Diff':
				previous_archive_name = support.make_archive_name(local_feed.get_name(), previous_release)
				previous_archive_file = '..' + os.sep + previous_release + os.sep + previous_archive_name + '.tar.bz2'

				# For archives created by older versions of 0release
				if not os.path.isfile(previous_archive_file):
					old_previous_archive_file = '..' + os.sep + previous_archive_name + '.tar.bz2'
					if os.path.isfile(old_previous_archive_file):
						previous_archive_file = old_previous_archive_file

				if os.path.isfile(previous_archive_file):
					support.unpack_tarball(previous_archive_file)
					try:
						support.show_diff(previous_archive_name, archive_name)
					finally: