version: '2'
pipelines:
  - mpp-import-pipelines:
      path: ../manifests/fedora-vars.ipp.yaml
  - mpp-import-pipeline:
      path: ../manifests/fedora-build-v2.ipp.yaml
      id: build
    runner:
      mpp-format-string: org.osbuild.fedora{release}
  - name: tree
    build: name:build
    stages:
      - type: org.osbuild.rpm
        inputs:
          packages:
            type: org.osbuild.files
            origin: org.osbuild.source
            mpp-depsolve:
              architecture: $arch
              module-platform-id: $module_platform_id
              repos:
                mpp-eval: repos
              packages:
                - nftables
                - openssh-server
                - systemd
        options:
          gpgkeys:
            mpp-eval: gpgkeys
          exclude:
            docs: true

      - type: org.osbuild.systemd.unit.create
        options:
          filename: create-directory.service
          unit-type: "global"
          unit-path: "etc"
          config:
            Unit:
              Description: Create directory
              DefaultDependencies: false
              ConditionPathExists:
                - "|!/etc/myfile"
              ConditionPathIsDirectory:
                - "|!/etc/mydir"
            Service:
              Type: "oneshot"
              RemainAfterExit: true
              ExecStart:
                - mkdir -p /etc/mydir
                - touch /etc/myfile
              Environment:
                - key: "DEBUG"
                  value: "1"
              EnvironmentFile:
                - "/etc/example.env"
            Install:
              WantedBy:
                - local-fs.target
              RequiredBy:
                - multi-user.target

      - type: org.osbuild.systemd.unit.create
        options:
          filename: data.mount
          config:
            Unit:
              DefaultDependencies: true
            Mount:
              What: "/dev/sdb1"
              Where: "/data"

      - type: org.osbuild.systemd.unit.create
        options:
          filename: service.socket
          config:
            Unit:
              DefaultDependencies: true
            Socket:
              ListenStream: "/run/service/api.socket"

      - type: org.osbuild.systemd.unit.create
        options:
          filename: "dev-disk-by\x2duuid-4f581be3\x2de8c2\x2d4b44\x2d9456\x2d54df3ab92944.swap"
          config:
            Unit:
              DefaultDependencies: true
            Swap:
              What: "/dev/disk/by-uuid/4f581be3-e8c2-4b44-9456-54df3ab92944"
