1[
2  {
3    "cmd": [
4      "python",
5      "-u",
6      "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n  if os.path.exists(path):\n    print \"%s exists but is not a dir\" % path\n    sys.exit(1)\n  os.makedirs(path, mode)\n",
7      "[START_DIR]/tmp_upload",
8      "511"
9    ],
10    "infra_step": true,
11    "name": "makedirs tmp dir",
12    "~followup_annotations": [
13      "@@@STEP_LOG_LINE@python.inline@@@@",
14      "@@@STEP_LOG_LINE@python.inline@import sys, os@@@",
15      "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@",
16      "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@",
17      "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@",
18      "@@@STEP_LOG_LINE@python.inline@  if os.path.exists(path):@@@",
19      "@@@STEP_LOG_LINE@python.inline@    print \"%s exists but is not a dir\" % path@@@",
20      "@@@STEP_LOG_LINE@python.inline@    sys.exit(1)@@@",
21      "@@@STEP_LOG_LINE@python.inline@  os.makedirs(path, mode)@@@",
22      "@@@STEP_LOG_END@python.inline@@@"
23    ]
24  },
25  {
26    "cmd": [
27      "python",
28      "-u",
29      "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
30      "[START_DIR]/dm/dm.json",
31      "[START_DIR]/tmp_upload"
32    ],
33    "name": "copy dm.json"
34  },
35  {
36    "cmd": [
37      "python",
38      "-u",
39      "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
40      "[START_DIR]/dm/verbose.log",
41      "[START_DIR]/tmp_upload"
42    ],
43    "name": "copy verbose.log"
44  },
45  {
46    "cmd": [
47      "python",
48      "-u",
49      "\nimport os\nimport sys\nos.remove(sys.argv[1])\n",
50      "[START_DIR]/dm/dm.json"
51    ],
52    "name": "rm old dm.json",
53    "~followup_annotations": [
54      "@@@STEP_LOG_LINE@python.inline@@@@",
55      "@@@STEP_LOG_LINE@python.inline@import os@@@",
56      "@@@STEP_LOG_LINE@python.inline@import sys@@@",
57      "@@@STEP_LOG_LINE@python.inline@os.remove(sys.argv[1])@@@",
58      "@@@STEP_LOG_END@python.inline@@@"
59    ]
60  },
61  {
62    "cmd": [
63      "python",
64      "-u",
65      "\nimport os\nimport sys\nos.remove(sys.argv[1])\n",
66      "[START_DIR]/dm/verbose.log"
67    ],
68    "name": "rm old verbose.log",
69    "~followup_annotations": [
70      "@@@STEP_LOG_LINE@python.inline@@@@",
71      "@@@STEP_LOG_LINE@python.inline@import os@@@",
72      "@@@STEP_LOG_LINE@python.inline@import sys@@@",
73      "@@@STEP_LOG_LINE@python.inline@os.remove(sys.argv[1])@@@",
74      "@@@STEP_LOG_END@python.inline@@@"
75    ]
76  },
77  {
78    "cmd": [
79      "python",
80      "-u",
81      "\nimport glob\nimport sys\nwith open(sys.argv[1], 'w') as f:\n  f.write('\\n'.join(glob.glob(sys.argv[2])))\n",
82      "/path/to/tmp/",
83      "[START_DIR]/dm/*"
84    ],
85    "infra_step": true,
86    "name": "find images"
87  },
88  {
89    "cmd": [
90      "gsutil",
91      "cp",
92      "[START_DIR]/dm/*",
93      "gs://skia-infra-gm/dm-images-v1"
94    ],
95    "name": "upload images"
96  },
97  {
98    "cmd": [
99      "gsutil",
100      "cp",
101      "-z",
102      "json,log",
103      "[START_DIR]/tmp_upload/*",
104      "gs://skia-infra-gm/trybot/dm-json-v1/2012/05/14/12/abc123/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/1337000001/12345/1002"
105    ],
106    "name": "upload JSON and logs"
107  },
108  {
109    "name": "$result",
110    "recipe_result": null,
111    "status_code": 0
112  }
113]