| 1234567891011121314151617181920212223242526272829303132333435 |
- name: "MyCustomLinuxComponent"
- description: "A custom Image Builder component for Linux with shell commands."
- schemaVersion: 1.0
- phases:
- - name: build
- steps:
- - name: InstallPackages
- action: ExecuteBash
- inputs:
- commands:
- - "sudo yum update -y"
- - "sudo yum install -y httpd"
- - "sudo systemctl enable httpd"
- - "sudo systemctl start httpd"
- onFailure: "Abort" # Option to abort the build on failure
- - name: ConfigureWebServer
- action: ExecuteBash
- inputs:
- commands:
- - "echo 'Hello from Image Builder!' | sudo tee /var/www/html/index.html"
- onFailure: "Continue" # Option to continue even if this step fails
- - name: test
- steps:
- - name: VerifyWebServer
- action: ExecuteBash
- inputs:
- commands:
- - "curl -s http://localhost | grep 'Hello from Image Builder!'"
- onFailure: "Abort"
- - name: CheckServiceStatus
- action: ExecuteBash
- inputs:
- commands:
- - "sudo systemctl is-active httpd"
- onFailure: "Abort"
|