Skip to content
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.

Commit

Permalink
Cleaup the hardcoded values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Tabara committed Feb 6, 2017
1 parent ae49e1a commit d3d932e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 6 additions & 0 deletions beetmoverscript/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@
'pub/mobile/release': 'release',
'pub/firefox/release': 'release',
}
RELEASE_BRANCHES = (
'mozilla-central',
'mozilla-aurora',
'mozilla-beta',
'mozilla-release'
)
20 changes: 7 additions & 13 deletions beetmoverscript/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from scriptworker.exceptions import ScriptWorkerTaskException, ScriptWorkerRetryException
from scriptworker.utils import retry_async, raise_future_exceptions

from beetmoverscript.constants import MIME_MAP
from beetmoverscript.constants import MIME_MAP, RELEASE_BRANCHES
from beetmoverscript.task import (validate_task_schema, add_balrog_manifest_to_artifacts,
get_upstream_artifacts, get_initial_release_props_file,
validate_task_scopes, add_checksums_to_artifacts,
Expand Down Expand Up @@ -114,18 +114,12 @@ def enrich_balrog_manifest(context, pretty_name, locale, destinations):
release_props = context.release_props
checksums = context.checksums

if release_props["branch"] == 'date':
# nightlies from dev branches don't usually upload to archive.m.o but
# in this particular case we're gradually rolling out in the
# archive.m.o under the latest-date corresponding bucket subfolder
url = "{prefix}/{s3_key}".format(prefix="https://archive.mozilla.org",
s3_key=destinations[0])
url_replacements = []
else:
# we extract the dated destination as the 'latest' is useless
url = "{prefix}/{s3_key}".format(prefix="https://archive.mozilla.org",
s3_key=destinations[0])
url_replacements = [['http://archive.mozilla.org/pub', 'http://download.cdn.mozilla.net/pub']]
url = "{prefix}/{s3_key}".format(prefix="https://archive.mozilla.org",
s3_key=destinations[0])
url_replacements = []
if release_props["branch"] in RELEASE_BRANCHES:
url_replacements.append(['http://archive.mozilla.org/pub',
'http://download.cdn.mozilla.net/pub'])

return {
"tc_nightly": True,
Expand Down

0 comments on commit d3d932e

Please sign in to comment.