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 |
Set the visibility to Public.
Navigate to the main page of the repository. Under your repository name click Settings, Under Features, select the Issues checkbox.
Click the Green button to enable Github Workflows
Click Secret -> Actions in the menu on the left
Click on the “New repository secret” button and create the following secrets
Variable | info | where to find it |
---|---|---|
CA_TOKEN | Cloudautomation Token | Cloudautomation UI |
DOCKERHUB | Dockerhub Token | Dockerhub |
DOCKER_USER | Dockerhub User | Dockerhub |
DT_API_TOKEN | Dynatrace Api Token | Access Token in Dynatrace |
DT_URL | Dynatrace URL | for example https://xxxxx.live.dynatrace.com |
DT_API_URL | Dynatrace API URL | for example https://xxxxx.live.dynatrace.com/api |
DT_CA_URL | Cloudautomation URL | for example https://xxxx.cloudautomation.live.dynatrace.com |
DT_DATAINGESTTOKEN | Dynatrace Data Ingest Token base64 encoded | In Dynatrace click on create a new Active Gate, in the setup page create new tokens and download the dynacube.yaml In the Dynacube.yaml you will fin d the base64 encoded Data ingest token |
DT_API_TOKEN_B64 | Dynatrace Api Token | In Dynatrace click on create a new Active Gate, in the setup page create new tokens and download the dynacube.yaml In the Dynacube.yaml you will fin d the base64 encoded Data ingest token |
WORKFLOW_TOKEN | Github Personal Access Token | Githui UI |
In the Workflow Overview click on the "Create Project Board" Workflow in the Menu
Click the Run Workflow Button on the right, chose the Master Branch and Click the Green Run Workflow Button
Wait until the Workflow run has finished
Click on the Simplenodeservice Project
Put the Project Columns into the right order via drag and drop (When the workflow creates the project it doesn’t keep the order) todo, in progress, Ready for Review, Done, Shipped
Navigate to the home of your Github Repository and click on Settings
Click Environments in the left Menu
Click on the “New Environment” Button
Create Environment with the Name “production-approval”
Activate Required reviewers and add yourself
Navigate to the home of your Github Repository and click on Settings
On the settings page click on Actions - Runners
In the runners overview click on the green “New Self-hosted runner” button
On the Create Runners page select “Linux”
Copy the token from the Configure script
Copy the entire Content of the “aws/userdatafile.sh” file in your Github Repository to a local text file editor, replace "< token >" with the token you have copied from the configure script and "< github repourl >" with the url to the repository you have created. Save the script we wil need it for installation of the AWS instance.
Do not close the Github Runner Installation page until the installation of the AWS Instance in the next step has been created.
Logon to the AWS Management Console and Navigate to EC2
Click on the “Launch Instances” button
Chose AMI (Amazon Linux 2 AMI Kernel 4)
Choose Instance Type T3.xlarge and click next
Scroll to the Bottom of the page until you get to Advanced Details - User data, paste the content of the userdatafiel.sh with the replaced token and github url into the user data field.
Add Storage (50GB General Purpose SSD) and click on next
Optional Add Tags
Create a Security Group with the following entries (click my IP will enter your IP address making the instance only available from your ip address!) Review and Launch instance.
Wait until your instance is in “Running” State
Go back to your Github runner install page and click on Actions - Runners. The Runner started and should be in Idle state as seen below (with a different ip address than in the picture)
The Workflow will create the following Demo Content:
Navigate to the home of your Github Repository and click on Actions
In the Actions view Click on the “Install Demo” Workflow
Now click the”Run workflow” button
Chose run from “Master” Branche
Click on the Green Run Workflow button
Wait until workflow finished
Go to your Cloudautomation instance
the Install Workflow has created a project called "slo-evaluation" and "deployment-gates" go into the slo-evaluation project and click on settings, in settings click on integrations and chose Webhook-Service
scroll to the bottom of the page and click on "add subscription"
in Add Subcription select Task evaluation and Task suffix finished
Filter by stages dev, staging, production
Requst Method POST
enter the Url < your dnyatrace url >/api/v1/entity/infrastructure/custom/custom:releaseevaluationscore
add headers accept = application/json, Authorization=Api-Token < your dynatrace api token >, content-type=application/json
add Custom Payload
{
"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}}"
},
"dataPoints": [
[
{
{.data.labels.evaltime
}
},
{
{.data.evaluation.score
}
}
]
]
}
]
}
Scroll to the bottom of the page and click the "update subcription" button
Repeat the same steps as above for the deployment-gates project but with the following content as payload:
{
"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
}
}
]
]
}
]
}
Navigate to the home of your Github Repository
Change Current Branche to “Dev”
Switch into directory .”github/workflow”
Open the dev.yml file for edit
Set the env: variables
Variable | info | Where to find it |
---|---|---|
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 | |
DT_MZ_ID | Dynatrace Management zone id | the install workflow has created a Management Zone called "tnt-acer-svc" in your Dynatrace instanceyou can get the ID from a Dashboard link where the management zone wa set (gf=246278738970986) |
DT_DEV_DB_ID | Dynatrace Dev Slo Dashboard id | The Install workflow has created a Dashboard Called KQG;project=slo-evaluation;stage=dev;service=tnt-acer-svc, go to this dashboard and get the id from the url (;id=76196020-e322-42c2-bc82-f7868171247e) |
DT_STAGING_DB_ID | Dynatrace Staging Slo Dashboard id | The Install workflow has created a Dashboard Called KQG;project=slo-evaluation;stage=staging;service=tnt-acer-svc, go to this dashboard and get the id from the url (;id=76196020-e322-42c2-bc82-f7868171247e) |
DT_PROD_DB_ID | Dynatrace Production Slo Dashboard id | The Install workflow has created a Dashboard Called KQG;project=slo-evaluation;stage=production;service=tnt-acer-svc, go to this dashboard and get the id from the url (;id=76196020-e322-42c2-bc82-f7868171247e) |
DOCKER_TAG | Docker tag of your Ducker hub repo created in the first step |