aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipes/bundle_recipes.py
blob: 1c0f87a3ab9b9f9b443872d77bd25278c4cf4e07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


# Recipe module for Skia Swarming compile.


DEPS = [
  'recipe_engine/path',
  'recipe_engine/properties',
  'recipe_engine/shutil',
  'recipe_engine/step',
  'core',
  'run',
  'vars',
]


def RunSteps(api):
  api.core.setup()

  bundle_dir = api.vars.swarming_out_dir.join('recipe_bundle')
  with api.step.context({'cwd': api.vars.skia_dir}):
    if api.vars.is_trybot:
      # Recipe bundling requires that any changes be committed.
      api.run(api.step, 'Commit Patch', infra_step=True,
              cmd=['git', 'commit', '-a', '-m', 'Commit Patch'])
    recipes_py = api.vars.infrabots_dir.join('recipes.py')
    api.run(api.step, 'Bundle Recipes', infra_step=True,
            cmd=['python', recipes_py, 'bundle', '--destination', bundle_dir])

  api.run.check_failure()


def GenTests(api):
  yield (
    api.test('BundleRecipes') +
    api.properties(buildername='Housekeeper-PerCommit-BundleRecipes',
                   repository='https://skia.googlesource.com/skia.git',
                   revision='abc123',
                   path_config='kitchen',
                   swarm_out_dir='[SWARM_OUT_DIR]',
                   patch_issue=500,
                   patch_set=1,
                   patch_storage='gerrit') +
    api.properties.tryserver(
        buildername='Housekeeper-PerCommit-BundleRecipes',
        gerrit_project='skia',
        gerrit_url='https://skia-review.googlesource.com/') +
    api.path.exists(
        api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
    )
  )