diff --git a/.delivery_template/Makefile b/.delivery_template/Makefile new file mode 100644 index 0000000..4426871 --- /dev/null +++ b/.delivery_template/Makefile @@ -0,0 +1,16 @@ +.PHONY: install +install: + # TODO: Add your install logic here (installation of the delivery tool) + +.PHONY: uninstall +uninstall: + # TODO: Add your uninstall logic here + +.PHONY: deploy-app +deploy-app: + # TODO: Add your deploy-app logic here (podtato-head) + +.PHONY: test +test: install deploy-app + # TODO: Add your test logic here (podtato-head) + make uninstall diff --git a/.delivery_template/README.md b/.delivery_template/README.md new file mode 100644 index 0000000..8d45d32 --- /dev/null +++ b/.delivery_template/README.md @@ -0,0 +1,22 @@ +# Deliver with +![](https://img.shields.io/badge/--blue) +![PodTatoHead](https://img.shields.io/badge/PodTatoHead-v0.3.0-orange) + +Website:
+Repository: + +## Introduction + + +## Install + + +## Deliver +1. Step 1 +2. Step 2 +3. Step 3 + +6. Open http://localhost:8080 in your browser + +## Uninstall + \ No newline at end of file diff --git a/.delivery_template/app/PLACEHOLDER b/.delivery_template/app/PLACEHOLDER new file mode 100644 index 0000000..1f50131 --- /dev/null +++ b/.delivery_template/app/PLACEHOLDER @@ -0,0 +1,3 @@ +This folder should container the configuration needed to deploy the podtato-head application. + +Please remove this file, after you added the configuration to the folder. diff --git a/Makefile b/Makefile index c8d71cb..ae53903 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,15 @@ +NAME ?= "empty" +UNAME := $(shell uname) + .PHONY: test test: - find . -mindepth 1 -maxdepth 1 -not -path '*/.*' -type d -exec make -C {} test \; + find . -mindepth 1 -maxdepth 1 -not -path '*/.*' -type d -exec make -C {} test \; + +.PHONY: new-scenario +new-scenario: + if [[ "$(NAME)" == "empty" ]]; then echo "Please provide a scenario name"; exit 1; fi + cp -r .delivery_template $(NAME) + + sed "s//$(NAME)/g" $(NAME)/README.md > tmp && mv tmp $(NAME)/README.md + + diff --git a/README.md b/README.md index f647376..ff136e4 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,19 @@ Each delivery scenario includes a walkthrough (README.md) describing how to * deliver podtato-head using the infrastructure * And test that podtato-head is operating as expected. -Each delivery scenario also includes a test (test.sh) which automates the steps described in the walkthrough. You can pause a test after tests run and before teardown by setting the env var WAIT_FOR_DELETE=1, as in WAIT_FOR_DELETE=1 ./delivery/flux/test.sh. This lets you examine what the README and scripts do. +Each delivery scenario also includes a test (`make test`) which automates the steps described in the walkthrough. You can pause a test after tests run and before teardown by setting the env var WAIT_FOR_DELETE=1, as in WAIT_FOR_DELETE=1 ./delivery/flux/test.sh. This lets you examine what the README and scripts do. + +## Contribute +If you have a delivery scenario you'd like to add, please submit a pull request. We'd love to see what you've done! + +We provided a template for you (./delivery_template). You can simply prepare this for your service using `make new-scenario NAME=`. + +Then you can proceed as follows: +* Create the Walkthrough in your README.md +* Automate the steps (install, deliver, uninstall) in the Makefile +* Write a test script which runs the steps in the Makefile and verifies the result. Currently we are supporting KUTTL and shell scripts in our test framework. If you need additional tools, please open up an issue. +* Test your scenario by running `make test` in the root directory of the repository. +* Submit a pull request +* Ensure that your scenario is tested in the CI pipeline and everything works +* Celebrate! +