DannyBraaf / pacman

Apache License 2.0
0 stars 0 forks source link

Continuous improvement from Dev to Production


This is a tutorial to setup a sandbox environment that focusses on
how "Dynatrace Automated SLO Evaluation" can be implemented into an
Automated Software Delivery Process.


The functions outside the SLO Evaluation like Deployments and
Testing are not necessarily best practise, they were designed to serve the Purpose
to Quickly Test or Demo the Slo Evaluation Process from Dev to Production without
having to wait hours for a delivery step like Testing to complete.

Prerequisites


The following Accounts and Tokens are needed to create this Sandbox


Vendor Prerequisite
Dynatrace Account, Api Token, Data Ingest Token
Dynatrace Cloudautomation Account, Api Token
AWS Account
Dockerhub Account, Access Token
Github Account, Personal Access Token


Note! You can save some time if you collect all the needed URLs and Api-Tokens Pre Sandbox Installation. Store them safely with keepaas https://keepass.info/


Sandbox Setup


Create a repository in Docker Hub


Create a Repo from Template



Enable Issues for your Github Repository


Enable Github Workflow Actions for your Github Repository


Create Github Environment Variable Secrets



Create Github Project (by running workflow)






Create Github Environment

Create new Github Runner



AWS Set Up

Start Github Install Workflow

The Workflow will create the following Demo Content:


Create Webhooks in Cloudautomation

{
    "type": "test",
    "series": [
        {
            "timeseriesId": "custom:releaseevaluationscore",
            "dimensions": {
                "Score": {
                    {.data.evaluation.score
                    }
                },
                "Result": "{{.data.result}}",
                "Passed": 0,
                "Releaseversion": "{{.data.labels.buildId}}",
                "Buildversion": "{{.data.labels.buildId}}",
                "Buildnumber": {
                    {.data.labels.buildId
                    }
                },
                "Evaluationtime": "{{.time}}",
                "Application": "simplenodeservice-{{.data.stage}}-DG"
            },
            "dataPoints": [
                [
                    {
                        {.data.labels.evaltime
                        }
                    },
                    {
                        {.data.evaluation.score
                        }
                    }
                ]
            ]
        }
    ]
}

Here the one liner for the second wehbook

 {  "type": "test",  "series": [    {      "timeseriesId": "custom:releaseevaluationscore",      "dimensions": {        "Score" : {{.data.evaluation.score}},        "Result" : "{{.data.result}}",        "Passed" : 0,        "Releaseversion": "{{.data.labels.buildId}}",        "Buildversion": "{{.data.labels.buildId}}",        "Buildnumber":  {{.data.labels.buildId}},        "Evaluationtime": "{{.time}}",        "Application" : "simplenodeservice-{{.data.stage}}-DG"              },      "dataPoints" : [[ {{.data.labels.evaltime}}, {{.data.evaluation.score}} ]]                  }  ]}   

Create Github Branches for Staging and Dev

Set Workflow Variables

Variable info
GITHUB_PROJECT_URL https url to the Project of your Github Repo created earlier
DOCKER_REPO_URL Link to the Docker Hub Repo created in the first step
DT_URL Dynatrace URL
DOCKER_TAG Docker tag of your Docker hub repo created in the first step

Follow Initial Demo Workflow Run