| # Copyright 2020 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| - name: Setup tools |
| environment: |
| PATH: '{{ ansible_env.PATH }}:{{ ansible_env.HOME }}/depot_tools' |
| |
| block: |
| - name: Check that ~/chromiumos exists |
| stat: |
| path: ~/chromiumos |
| register: chromiumos_exists |
| |
| - name: Init ~/chromiumos |
| shell: | |
| cd ~ |
| mkdir -p chromiumos |
| cd ~/chromiumos |
| MANIFEST=https://chrome-internal.googlesource.com/chromeos/manifest-internal.git |
| REPO_URL=https://chromium.googlesource.com/external/repo.git |
| repo init -u "$MANIFEST" --repo-url="$REPO_URL" |
| repo sync |
| cros_sdk --create --nouse-image |
| cp src/scripts/mod_for_test_scripts/ssh_keys/testing_rsa ~/.ssh/ |
| chmod 0600 ~/.ssh/testing_rsa |
| # This is a hack to mount the .config folder created by gcloud auth under chroot. |
| echo "$HOME/.config" > src/scripts/.local_mounts |
| when: chromiumos_exists.stat.exists == false |
| |
| - name: Setup bisect-kit |
| shell: | |
| cd ~/chromiumos/src/platform/bisect-kit |
| pip3 install --user -r requirements.txt |
| pip3 install --no-cache-dir -U crcmod |
| |
| cat <<EOF > "$HOME/chromiumos/src/platform/bisect-kit/bisect_kit.json" |
| { |
| "include": [ |
| "internal/internal.json" |
| ], |
| |
| "plugins": [ |
| ], |
| |
| "options": { |
| "DEFAULT_CHROMEOS_ROOT": "$HOME/chromiumos" |
| } |
| } |
| EOF |
| when: chromiumos_exists.stat.exists == false |
| |
| - name: Init codes & setup chroot |
| shell: | |
| cd ~/chromiumos/src/platform/bisect-kit |
| ./setup_cros_bisect.py init --btrfs --chromeos |
| echo "$HOME/.config" > "$HOME/bisect-workdir/template/chromeos/src/scripts/.local_mounts" |
| ./setup_cros_bisect.py init --btrfs --chrome |
| when: chromiumos_exists.stat.exists == false |
| |
| - name: Install build deps packages |
| shell: | |
| cd ~/bisect-workdir/template/chrome/src |
| ./build/install-build-deps.sh --no-prompt |
| ./build/install-build-deps-android.sh --no-prompt |
| |
| # Pin the chromiumos version and only updates when creating an image |
| - name: Uprev bisect-kit |
| shell: | |
| cd ~/chromiumos/src/platform/bisect-kit |
| repo sync . |
| when: chromiumos_exists.stat.exists == true |
| |
| - name: Uprev bisect-workdir |
| shell: | |
| cd ~/chromiumos/src/platform/bisect-kit |
| ./setup_cros_bisect.py sync |
| when: chromiumos_exists.stat.exists == true |