pipeline.yaml 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ---
  2. name: MyCustomBuildWorkflow
  3. description: A custom build workflow to install updates and configure a web server.
  4. schemaVersion: 1.0
  5. parameters:
  6. - name: BaseImageAMI
  7. type: String
  8. description: The AMI to use as the base image for the build.
  9. - name: WebServerPort
  10. type: String
  11. description: The port for the web server.
  12. default: "80"
  13. steps:
  14. - name: InstallUpdates
  15. action: ExecuteBash
  16. inputs:
  17. commands:
  18. - "sudo yum update -y"
  19. - "sudo yum install -y httpd"
  20. onFailure: Abort
  21. - name: ConfigureWebServer
  22. action: ExecuteBash
  23. inputs:
  24. commands:
  25. - "echo 'Hello from Image Builder!' | sudo tee /var/www/html/index.html"
  26. - "sudo systemctl enable httpd"
  27. - "sudo systemctl start httpd"
  28. onFailure: Abort
  29. - name: TestWebServer
  30. action: ExecuteBash
  31. inputs:
  32. commands:
  33. - "curl localhost:{{ WebServerPort }}"
  34. onFailure: Abort
  35. outputs:
  36. - name: BuiltImageArn
  37. value: "{{ image.output.arn }}"