Example #1
0
	def set_to_snapshot(snapshot_version):
		assert snapshot_version.endswith('-post')
		support.publish(local_feed.local_path, set_released = '', set_version = snapshot_version)
		do_version_substitutions(local_impl_dir, version_substitutions, snapshot_version)
		scm.commit('Start development series %s' % snapshot_version, branch = TMP_BRANCH_NAME, parent = TMP_BRANCH_NAME)
		status.new_snapshot_version = scm.get_head_revision()
		status.save()
Example #2
0
	def set_to_release():
		print "Snapshot version is " + local_impl.get_version()
		release_version = options.release_version
		if release_version is None:
			suggested = support.suggest_release_version(local_impl.get_version())
			release_version = raw_input("Version number for new release [%s]: " % suggested)
			if not release_version:
				release_version = suggested

		scm.ensure_no_tag(release_version)

		status.head_before_release = scm.get_head_revision()
		status.save()

		working_copy = local_impl.id
		do_version_substitutions(local_impl_dir, version_substitutions, release_version)
		run_hooks('commit-release', cwd = working_copy, env = {'RELEASE_VERSION': release_version})

		print "Releasing version", release_version
		support.publish(local_feed.local_path, set_released = 'today', set_version = release_version)

		support.backup_if_exists(release_version)
		os.mkdir(release_version)
		os.chdir(release_version)

		status.old_snapshot_version = local_impl.get_version()
		status.release_version = release_version
		status.head_at_release = scm.commit('Release %s' % release_version, branch = TMP_BRANCH_NAME, parent = 'HEAD')
		status.save()
Example #3
0
	def set_to_snapshot(snapshot_version):
		assert snapshot_version.endswith('-post')
		support.publish(local_feed.local_path, set_released = '', set_version = snapshot_version)
		do_version_substitutions(local_impl_dir, version_substitutions, snapshot_version)
		scm.commit('Start development series %s' % snapshot_version, branch = TMP_BRANCH_NAME, parent = TMP_BRANCH_NAME)
		status.new_snapshot_version = scm.get_head_revision()
		status.save()
Example #4
0
	def set_to_release():
		print "Snapshot version is " + local_impl.get_version()
		release_version = options.release_version
		if release_version is None:
			suggested = support.suggest_release_version(local_impl.get_version())
			release_version = raw_input("Version number for new release [%s]: " % suggested)
			if not release_version:
				release_version = suggested

		scm.ensure_no_tag(release_version)

		status.head_before_release = scm.get_head_revision()
		status.save()

		working_copy = local_impl.id
		do_version_substitutions(local_impl_dir, version_substitutions, release_version)
		run_hooks('commit-release', cwd = working_copy, env = {'RELEASE_VERSION': release_version})

		print "Releasing version", release_version
		support.publish(local_feed.local_path, set_released = 'today', set_version = release_version)

		support.backup_if_exists(release_version)
		os.mkdir(release_version)
		os.chdir(release_version)

		status.old_snapshot_version = local_impl.get_version()
		status.release_version = release_version
		status.head_at_release = scm.commit('Release %s' % release_version, branch = TMP_BRANCH_NAME, parent = 'HEAD')
		status.save()
Example #5
0
	def create_feed(target_feed, local_iface_path, archive_file, archive_name, main):
		shutil.copyfile(local_iface_path, target_feed)

		support.publish(target_feed,
			set_main = main,
			archive_url = support.get_archive_url(options, status.release_version, os.path.basename(archive_file)),
			archive_file = archive_file,
			archive_extract = archive_name)
Example #6
0
	def create_feed(target_feed, local_iface_path, archive_file, archive_name, main):
		shutil.copyfile(local_iface_path, target_feed)

		support.publish(target_feed,
			set_main = main,
			archive_url = support.get_archive_url(options, status.release_version, os.path.basename(archive_file)),
			archive_file = archive_file,
			archive_extract = archive_name)
Example #7
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!"
Example #8
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!"