Skip to content

What is the execution order of substeps? #2295

Description

@jjqq2013

There seems no documentation about the execution order of substeps such as files, commands.

I have done some experiments, turns out that there are some rules existing in the internal implementation, I hope we can add the rules to the documentation.

==> /oem/91_custom.yml <==
name: "====test====1"
stages:
  initramfs:
   - name: "test step1"
     files:
       - path: /etc/file1
         permissions: 644
         owner: 0
         group: 0
         content: "file1"
     commands:
       - ls /etc/file1 2>&1 > /etc/cmd1.out

==> /oem/92_custom.yml <==
name: "====test====2"
stages:
  initramfs:
   - name: "test step1 of test2"
     commands:
       - ls /etc/file2 2>&1 > /etc/cmd2.out
     files:
       - path: /etc/file2
         permissions: 644
         owner: 0
         group: 0
         content: "file2"

==> /etc/cmd1.out <==
/etc/file1

==> /etc/cmd2.out <==
/etc/file2

Regardless of the order of files and commands, the files is always executed before commands.

So I am wondering, what is the rule?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions