def android_multiarch_release():
    module_build_tasks = build_gradle_modules_tasks(True)
    return (
        linux_build_task("All modules - Publish via bintray"
                         ).with_dependencies(*module_build_tasks.values())
        # Our -unpublished- artifacts were uploaded in build_gradle_modules_tasks(),
        # however there is not way to just trigger a bintray publish from gradle without
        # uploading anything, so we do it manually using curl :(
        # We COULD publish each artifact individually, however that would mean if
        # a build task fails we end up with a partial release.
        # Since we manipulate secrets, we also disable bash debug mode.
        .with_script("""
            python automation/taskcluster/release/fetch-bintray-api-key.py
            set +x
            BINTRAY_USER=$(grep 'bintray.user='******'=' -f2)
            BINTRAY_APIKEY=$(grep 'bintray.apikey=' local.properties | cut -d'=' -f2)
            PUBLISH_URL=https://api.bintray.com/content/mozilla-appservices/application-services/org.mozilla.appservices/{}/publish
            echo "Publishing on $PUBLISH_URL"
            curl -X POST -u $BINTRAY_USER:$BINTRAY_APIKEY $PUBLISH_URL
            echo "Success!"
            set -x
        """.format(appservices_version())).with_scopes(
            "secrets:get:project/application-services/publish").with_features(
                'taskclusterProxy')  # So we can fetch the bintray secret.
        .create())
Beispiel #2
0
def android_multiarch_release():
    module_build_tasks = build_gradle_modules_tasks(True)

    version = appservices_version()
    worker_type = os.environ['BEETMOVER_WORKER_TYPE']
    bucket_name = os.environ['BEETMOVER_BUCKET']
    bucket_public_url = os.environ['BEETMOVER_BUCKET_PUBLIC_URL']

    for module_info in module_definitions():
        module = module_info['name']
        build_task = module_build_tasks[module]
        for artifact in module_info['artifacts']:
            artifact_name = artifact['name']
            artifact_path = artifact['path']
            (BeetmoverTask("Publish Android module: {} via beetmover".format(
                artifact_name)).with_description(
                    "Publish release module {} to {}".format(
                        artifact_name,
                        bucket_public_url)).with_worker_type(worker_type)
             # We want to make sure ALL builds succeeded before doing a release.
             .with_dependencies(*module_build_tasks.values(
             )).with_upstream_artifact({
                 "paths": [artifact_path],
                 "taskId": build_task,
                 "taskType": "build",
                 "zipExtract": True,
             }).with_app_name("appservices").with_artifact_id(artifact_name).
             with_app_version(version).with_scopes(
                 "project:mozilla:application-services:releng:beetmover:bucket:{}"
                 .format(bucket_name),
                 "project:mozilla:application-services:releng:beetmover:action:push-to-maven"
             ).create())
def android_multiarch_release(is_staging):
    module_build_tasks = build_gradle_modules_tasks(
        DeployEnvironment.STAGING_RELEASE if is_staging else DeployEnvironment.
        RELEASE)

    version = appservices_version()
    bucket_name = os.environ['BEETMOVER_BUCKET']
    bucket_public_url = os.environ['BEETMOVER_BUCKET_PUBLIC_URL']

    for module_info in module_definitions():
        module = module_info['name']
        build_task = module_build_tasks[module]
        sign_task = (
            SignTask("Sign Android module: {}".format(module)).
            with_description("Signs module").with_worker_type(
                "appsv-signing-dep-v1" if is_staging else "appsv-signing-v1")
            # We want to make sure ALL builds succeeded before doing a release.
            .with_dependencies(*module_build_tasks.values(
            )).with_upstream_artifact({
                "paths": [
                    artifact["taskcluster_path"]
                    for publication in module_info["publications"]
                    for artifact in publication.to_artifacts(('', ))
                ],
                "formats": ["autograph_gpg"],
                "taskId":
                build_task,
                "taskType":
                "build"
            }).with_scopes(
                "project:mozilla:application-services:releng:signing:cert:{}-signing"
                .format("dep" if is_staging else "release")).create())

        (BeetmoverTask("Publish Android module: {} via beetmover".format(
            module)).with_description("Publish release module {} to {}".format(
                module, bucket_public_url)).with_worker_type(
                    os.environ['BEETMOVER_WORKER_TYPE']).
         with_dependencies(sign_task).with_upstream_artifact({
             "paths": [
                 artifact['taskcluster_path']
                 for publication in module_info["publications"]
                 for artifact in publication.to_artifacts(('', '.sha1',
                                                           '.md5'))
             ],
             "taskId":
             build_task,
             "taskType":
             "build",
         }).with_upstream_artifact({
             "paths": [
                 artifact['taskcluster_path']
                 for publication in module_info["publications"]
                 for artifact in publication.to_artifacts(('.asc', ))
             ],
             "taskId":
             sign_task,
             "taskType":
             "signing",
         }).with_app_name("appservices").with_artifact_map([
             {
                 "locale": "en-US",
                 "taskId": build_task,
                 "paths": {
                     artifact["taskcluster_path"]: {
                         "checksums_path":
                         "",  # TODO beetmover marks this as required, but it's not needed
                         "destinations": [artifact["maven_destination"]],
                     }
                     for publication in module_info["publications"]
                     for artifact in publication.to_artifacts(('', '.sha1',
                                                               '.md5'))
                 }
             },
             {
                 "locale": "en-US",
                 "taskId": sign_task,
                 "paths": {
                     artifact["taskcluster_path"]: {
                         "checksums_path":
                         "",  # TODO beetmover marks this as required, but it's not needed
                         "destinations": [artifact["maven_destination"]],
                     }
                     for publication in module_info["publications"]
                     for artifact in publication.to_artifacts(('.asc', ))
                 },
             }
         ]).with_app_version(version).with_scopes(
             "project:mozilla:application-services:releng:beetmover:bucket:{}".
             format(bucket_name),
             "project:mozilla:application-services:releng:beetmover:action:push-to-maven"
         ).with_routes(
             "[email protected]").create())