Skip to content

Commit

Permalink
feat: added new template
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Schuetz <thomas.schuetz@dynatrace.com>
  • Loading branch information
Thomas Schuetz committed Mar 16, 2023
1 parent 8f75d9a commit 8566445
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .delivery_template/Makefile
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions .delivery_template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Deliver with <DELIVERY_TOOL_NAME>
![<DELIVERY_TOOL_NAME>](https://img.shields.io/badge/<DELIVERY_TOOL_NAME>-<DELIVERY_TOOL_VERSION>-blue)
![PodTatoHead](https://img.shields.io/badge/PodTatoHead-v0.3.0-orange)

Website: <WEBSITE> <BR>
Repository: <GITHUB_REPO>

## Introduction
<!-- A short description of the tool and how it works in a nutshell -->

## Install
<!-- Installation instructions -->

## Deliver
1. Step 1
2. Step 2
3. Step 3

6. Open http://localhost:8080 in your browser

## Uninstall
<!-- Uninstall instructions -->
3 changes: 3 additions & 0 deletions .delivery_template/app/PLACEHOLDER
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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/<DELIVERY_TOOL_NAME>/$(NAME)/g" $(NAME)/README.md > tmp && mv tmp $(NAME)/README.md


17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<YOUR_SERVICE_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!

0 comments on commit 8566445

Please # to comment.