Skip to content

Commit

Permalink
build: change upload-to-s3 vars to upload-to-storage (#34142)
Browse files Browse the repository at this point in the history
* build: change upload-to-s3 vars to upload-to-az

* build: change upload-to-az to upload-to-storage

* build: change linux-ia32-publish var

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
  • Loading branch information
trop[bot] and VerteDinde committed May 11, 2022
1 parent a8f8b50 commit 8bc25e8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Expand Up @@ -14,8 +14,7 @@ parameters:
type: boolean
default: false

# TODO (vertedinde): migrate this variable to upload-to-az
upload-to-s3:
upload-to-storage:
type: string
default: '1'

Expand Down
24 changes: 12 additions & 12 deletions .circleci/config/base.yml
Expand Up @@ -5,7 +5,7 @@ parameters:
type: boolean
default: false

upload-to-s3:
upload-to-storage:
type: string
default: '1'

Expand Down Expand Up @@ -639,9 +639,9 @@ step-electron-publish: &step-electron-publish
fi
cd src/electron
if [ "$UPLOAD_TO_S3" == "1" ]; then
echo 'Uploading Electron release distribution to S3'
script/release/uploaders/upload.py --verbose --upload_to_s3
if [ "$UPLOAD_TO_STORAGE" == "1" ]; then
echo 'Uploading Electron release distribution to Azure'
script/release/uploaders/upload.py --verbose --UPLOAD_TO_STORAGE
else
echo 'Uploading Electron release distribution to Github releases'
script/release/uploaders/upload.py --verbose
Expand Down Expand Up @@ -1749,7 +1749,7 @@ jobs:
environment:
<<: *env-linux-2xlarge-release
<<: *env-release-build
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
<<: *env-ninja-status
steps:
- run: echo running
Expand Down Expand Up @@ -1798,7 +1798,7 @@ jobs:
<<: *env-ia32
<<: *env-release-build
<<: *env-32bit-release
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
<<: *env-ninja-status
steps:
- run: echo running
Expand Down Expand Up @@ -1850,7 +1850,7 @@ jobs:
<<: *env-release-build
<<: *env-32bit-release
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
<<: *env-ninja-status
steps:
- run: echo running
Expand Down Expand Up @@ -1911,7 +1911,7 @@ jobs:
<<: *env-arm64
<<: *env-release-build
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
<<: *env-ninja-status
steps:
- run: echo running
Expand Down Expand Up @@ -1954,7 +1954,7 @@ jobs:
environment:
<<: *env-mac-large-release
<<: *env-release-build
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
<<: *env-ninja-status
steps:
- run: echo running
Expand All @@ -1974,7 +1974,7 @@ jobs:
<<: *env-mac-large-release
<<: *env-release-build
<<: *env-apple-silicon
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
<<: *env-ninja-status
steps:
- run: echo running
Expand Down Expand Up @@ -2037,7 +2037,7 @@ jobs:
<<: *env-mac-large-release
<<: *env-mas
<<: *env-release-build
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
steps:
- run: echo running
- when:
Expand All @@ -2056,7 +2056,7 @@ jobs:
<<: *env-mac-large-release
<<: *env-mas-apple-silicon
<<: *env-release-build
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
<<: *env-ninja-status
steps:
- run: echo running
Expand Down
8 changes: 4 additions & 4 deletions appveyor.yml
Expand Up @@ -11,7 +11,7 @@
# - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64', 'mips64el'}.
# Is used in some publishing scripts, but does NOT affect the Electron binary.
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
# - "UPLOAD_TO_S3" Set it to '1' upload a release to the S3 bucket.
# - "UPLOAD_TO_STORAGE" Set it to '1' upload a release to the Azure bucket.
# Otherwise the release will be uploaded to the Github Releases.
# (The value is only checked if "ELECTRON_RELEASE" is defined.)
#
Expand Down Expand Up @@ -231,9 +231,9 @@ deploy_script:
- cd electron
- ps: >-
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\UPLOAD_TO_S3) {
Write-Output "Uploading Electron release distribution to s3"
& python script\release\uploaders\upload.py --verbose --upload_to_s3
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
Write-Output "Uploading Electron release distribution to azure"
& python script\release\uploaders\upload.py --verbose --upload_to_storage
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python script\release\uploaders\upload.py --verbose
Expand Down
6 changes: 3 additions & 3 deletions script/release/ci-release-build.js
Expand Up @@ -62,9 +62,9 @@ async function circleCIcall (targetBranch, workflowName, options) {
parameters: {}
};
if (options.ghRelease) {
buildRequest.parameters['upload-to-s3'] = '0';
buildRequest.parameters['upload-to-storage'] = '0';
} else {
buildRequest.parameters['upload-to-s3'] = '1';
buildRequest.parameters['upload-to-storage'] = '1';
}
buildRequest.parameters[`run-${workflowName}`] = true;
if (options.arch) {
Expand Down Expand Up @@ -205,7 +205,7 @@ async function callAppVeyor (targetBranch, job, options) {
};

if (!options.ghRelease) {
environmentVariables.UPLOAD_TO_S3 = 1;
environmentVariables.UPLOAD_TO_STORAGE = 1;
}

const requestOpts = {
Expand Down
18 changes: 9 additions & 9 deletions script/release/uploaders/upload.py
Expand Up @@ -45,7 +45,7 @@ def main():
args = parse_args()
if args.verbose:
enable_verbose_mode()
if args.upload_to_s3:
if args.upload_to_storage:
utcnow = datetime.datetime.utcnow()
args.upload_timestamp = utcnow.strftime('%Y%m%d')

Expand All @@ -62,7 +62,7 @@ def main():
if not release['draft']:
tag_exists = True

if not args.upload_to_s3:
if not args.upload_to_storage:
assert release['exists'], \
'Release does not exist; cannot upload to GitHub!'
assert tag_exists == args.overwrite, \
Expand Down Expand Up @@ -140,7 +140,7 @@ def main():
OUT_DIR, 'hunspell_dictionaries.zip')
upload_electron(release, hunspell_dictionaries_zip, args)

if not tag_exists and not args.upload_to_s3:
if not tag_exists and not args.upload_to_storage:
# Upload symbols to symbol server.
run_python_upload_script('upload-symbols.py')
if PLATFORM == 'win32':
Expand All @@ -165,9 +165,9 @@ def parse_args():
parser.add_argument('-p', '--publish-release',
help='Publish the release',
action='store_true')
parser.add_argument('-s', '--upload_to_s3',
help='Upload assets to s3 bucket',
dest='upload_to_s3',
parser.add_argument('-s', '--upload_to_storage',
help='Upload assets to azure bucket',
dest='upload_to_storage',
action='store_true',
default=False,
required=False)
Expand Down Expand Up @@ -332,9 +332,9 @@ def upload_electron(release, file_path, args):
except NonZipFileError:
pass

# if upload_to_s3 is set, skip github upload.
# todo (vertedinde): migrate this variable to upload_to_az
if args.upload_to_s3:
# if upload_to_storage is set, skip github upload.
# todo (vertedinde): migrate this variable to upload_to_storage
if args.upload_to_storage:
key_prefix = 'release-builds/{0}_{1}'.format(args.version,
args.upload_timestamp)
store_artifact(os.path.dirname(file_path), key_prefix, [file_path])
Expand Down

0 comments on commit 8bc25e8

Please sign in to comment.