-
Notifications
You must be signed in to change notification settings - Fork 16
/
.travis.yml
105 lines (105 loc) · 10.8 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
os: linux
dist: focal
language: shell
if: fork = false
notifications:
email:
on_success: never
stages:
- tests
- build-package
- e2e-test
- deployment
env:
global:
- RELEASE_REPO_TO_FIND="https://github.com/dynatrace-oss/dynatrace-azure-log-forwarder/releases/latest/download/"
- RELEASE_REPO_TO_REPLACE="https://github.com/dynatrace-oss/dynatrace-azure-log-forwarder/releases/download/$TRAVIS_TAG/"
- STORAGE_ACCOUNT_NAME="e2erepository"
- STORAGE_ACCOUNT_DIR_NAME="e2edeployment${TRAVIS_BUILD_ID}"
- secure: sDNv5zI4GfrSMODSdRJ+6NbTh7ppg9eLFGlfTS/hneOBF7Zgt9Yi8P71+OehiAqPOGuXe5L6nP3CqgcCFQzl2oUTgl+aU8ZQFSL4nTX5cstc0T06yqMuyzSr9dGbZFYP3Hb27NpJk7KVe/ddOfTcL/MmEsOJqMuzVvklL7GzuxbjlVm6O1Rhc94lsEWctPaS337yOlrc5CKAxFuTl3ohou3Tode9MuZeVd4XKcxrhfZl/8BAYtfV8wim8hwYDXKTBjcOfB7qd8+3Un4tYAXMGjx5wYKOVOoihuim/7sDn0V+YxHKFhXJp8lWa7oITQaGhlMHGNSCNPdQ0nxnntfdKUtD2rxhAjTUXhoaF+bk4mrjRGxgXN80P9rrQjSCN0JyjWx4tnWj2ivjmhGHQZl4swvMp7k9Sikyj0f9KevtsotQBYAQEzTuzPi0kf9uDiZ05/fnttsHpYKw+BpWqbzl5NBQAuJQuoRREwOGOS4CSpybRhS9Bx/i2+lgfT5NXhr76KWD/uN5KurZvuBgbVzdWSXxq4zh6vM2R9iyvgsCN1TzpU/JXfnQDHC8OJMRDqX7pGoYzwEnq6jatRf8ED7yFm86a5hW1u7bWgIgC3TrkCTXcyZvh8lOKl647i9cxCjLfy411PFim8Ic2UY5jMAEMfVwpLV3HcXbZ7ye8HK/bWI=
jobs:
include:
- stage: tests
name: Tests & Linting
language: python
python:
- "3.9"
install:
- pip install -r requirements.txt
- pip install -r tests/requirements.txt
- pip install pylint==2.7.2
addons:
apt:
packages:
- default-jre
script:
- pylint --rcfile=pylint.cfg ./logs_ingest
- pylint --rcfile=pylint-tests.cfg ./tests
- pytest tests/unit -v
- pytest tests/integration -v
- stage: build-package
name: Building package & Deploying to Storage Account
sudo: required
language: minimal
install:
- curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
script:
- ./buildZip.sh
- az storage fs create --name "$STORAGE_ACCOUNT_DIR_NAME" --account-name "$STORAGE_ACCOUNT_NAME" --account-key "$STORAGE_ACCOUNT_KEY" --public-access file
- az storage fs file upload --file-system "$STORAGE_ACCOUNT_DIR_NAME" --account-name "$STORAGE_ACCOUNT_NAME" --account-key "$STORAGE_ACCOUNT_KEY" --source "publish.zip" --path "dynatrace-azure-log-forwarder.zip"
- az storage fs file upload --file-system "$STORAGE_ACCOUNT_DIR_NAME" --account-name "$STORAGE_ACCOUNT_NAME" --account-key "$STORAGE_ACCOUNT_KEY" --source "deployment/dynatrace-azure-forwarder.json" --path "dynatrace-azure-forwarder.json"
- stage: e2e-test
name: E2E Azure Log Forwarder test
sudo: required
language: python
python:
- "3.9"
env:
- RESOURCE_GROUP_NAME="logs-forwarding-e2e-rg-${TRAVIS_BUILD_ID}"
- RESOURCE_GROUP_STATIC_RESOURCES="logs-forwarding-e2e-static-resources"
- LOGIC_APP_NAME="logs-forwarding-e2e-logicapp"
- LOGIC_APP_RESOURCE_TYPE="Microsoft.Logic/workflows"
- secure: m5BnOt9xH87aAARQNnfagFQj4qvv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BTK0vXcWWlQgttqQEyT41qRU5kvkDfCc1UFDYWkVfaaRs0t+l4W+2YmtzIpDQk081JqFZHz6fXbadAIQu+J8Igap6bp9Y86eMUlLIwc4=
install:
- curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- pip install -r tests/requirements.txt
before_script:
- az login --service-principal --username "$USER_NAME" --password "$PASSWORD" --tenant "$TENANT" > /dev/null
- az account set --subscription "$SUBSCRIPTION"
- az group create --name "$RESOURCE_GROUP_NAME" --location westeurope
- az resource invoke-action --action enable --name "$LOGIC_APP_NAME" -g "$RESOURCE_GROUP_STATIC_RESOURCES" --resource-type "$LOGIC_APP_RESOURCE_TYPE"
script:
- ./deployment/dynatrace-azure-logs.sh --deployment-name "e2e${TRAVIS_BUILD_ID}" --resource-group "$RESOURCE_GROUP_NAME" --target-url "$TARGET_URL" --target-api-token "$TARGET_API_TOKEN" --use-existing-active-gate true --event-hub-connection-string "$EH_CONNECTION_STRING" --repository-release-url "https://${STORAGE_ACCOUNT_NAME}.blob.core.windows.net/${STORAGE_ACCOUNT_DIR_NAME}/"
- pytest tests/e2e -v
after_script:
- az group delete --name "$RESOURCE_GROUP_NAME" --yes
- az resource invoke-action --action disable --name "$LOGIC_APP_NAME" -g "$RESOURCE_GROUP_STATIC_RESOURCES" --resource-type "$LOGIC_APP_RESOURCE_TYPE"
- if [[ ! $TRAVIS_TAG =~ ^release.*$ ]]; then az storage fs delete --name "$STORAGE_ACCOUNT_DIR_NAME" --account-name "$STORAGE_ACCOUNT_NAME" --account-key "$STORAGE_ACCOUNT_KEY" --yes; fi
- stage: deployment
name: Github Release Deployment
if: tag =~ /^release.*$/
language: shell
install:
- curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
before_deploy:
- wget "https://${STORAGE_ACCOUNT_NAME}.blob.core.windows.net/${STORAGE_ACCOUNT_DIR_NAME}/dynatrace-azure-log-forwarder.zip"
- sed -i -e "s@$RELEASE_REPO_TO_FIND@$RELEASE_REPO_TO_REPLACE@g" ./deployment/dynatrace-azure-logs.sh
deploy:
provider: releases
api_key: $GITHUB_RELEASE_API_KEY
file:
- ./dynatrace-azure-log-forwarder.zip
- ./deployment/dynatrace-azure-forwarder.json
- ./deployment/dynatrace-azure-logs.sh
skip_cleanup: true
on:
tags: true
after_deploy:
- az storage fs delete --name "$STORAGE_ACCOUNT_DIR_NAME" --account-name "$STORAGE_ACCOUNT_NAME" --account-key "$STORAGE_ACCOUNT_KEY" --yes