Skip to content

Oniro Migration: initial PVC

Oniro pipeline need prerequisite about directory initialization

with test in pipeline:

- test "$(id -u)" -ne 0 || (
        echo "precondition failed - this job cannot run as root"
        && exit 1 )
    # Check if the job is configured properly.
    - test -n "$CI_ONIRO_BUILD_FLAVOUR" || (
        echo "precondition failed - set CI_ONIRO_BUILD_FLAVOUR to \"flavour\" of the build to use (e.g. linux)"
        && exit 1 )
    - test -n "$MACHINE" || (
        echo "precondition failed - set MACHINE to supported machines (e.g. qemux86-64)"
        && exit 1 )
    # Check devtool operation is enabled and configured properly.
    - |
      if { [ -n "$CI_ONIRO_DEVTOOL_RECIPE_NAME" ] && [ -z "$CI_ONIRO_DEVTOOL_LAYER_PATH" ]; } || { [ -z "$CI_ONIRO_DEVTOOL_RECIPE_NAME" ] && [ -n "$CI_ONIRO_DEVTOOL_LAYER_PATH" ]; } then
        echo "precondition failed - cannot define just one of CI_ONIRO_DEVTOOL_RECIPE_NAME and CI_ONIRO_DEVTOOL_LAYER_PATH"
        exit 1
      fi
    # Bitbake is configured to use $CI_ONIRO_RUNNER_PERSISTENT_STORAGE/$CI_ONIRO_BUILD_CACHE/bitbake
    # directory for both the download directory and the sstate-cache.
    - test -n "$CI_ONIRO_RUNNER_PERSISTENT_STORAGE" || (
        echo "precondition failed - CI_ONIRO_RUNNER_PERSISTENT_STORAGE is not set"
        && exit 1 )
    - test -w "$CI_ONIRO_RUNNER_PERSISTENT_STORAGE/$CI_ONIRO_BUILD_CACHE/bitbake" || (
        echo "precondition failed - expected $CI_ONIRO_RUNNER_PERSISTENT_STORAGE/$CI_ONIRO_BUILD_CACHE/bitbake to be writable"
        && exit 1 )