forked from ForgeRock/forgeops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild-smoketests.yaml
79 lines (66 loc) · 2.2 KB
/
cloudbuild-smoketests.yaml
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
# Cloudbuild pipeline for smoke tests
steps:
## List helm to init everything
- name: 'gcr.io/engineering-devops/helm'
args: ['list']
env:
- 'CLOUDSDK_COMPUTE_ZONE=us-east1-c'
- 'CLOUDSDK_CONTAINER_CLUSTER=eng-shared'
# Ensure kctl is working
- name: 'gcr.io/engineering-devops/helm'
entrypoint: 'kubectl'
args: ['get', 'pods']
# Run remove all before tests to ensure namespace is clear before test run
- name: 'gcr.io/engineering-devops/helm'
entrypoint: 'bin/remove-all.sh'
args: ['-N','smoke']
# Run deployment scripts
- name: 'gcr.io/engineering-devops/helm'
entrypoint: 'bin/deploy.sh'
args: ['samples/config/smoke-deployment']
# Run custom smoke test image
- name: 'gcr.io/$PROJECT_ID/forgeops-tests:latest'
dir: 'cicd/forgeops-tests/'
env:
- 'IDM_URL=https://openidm.smoke.forgeops.com/openidm'
- 'IDM_ADMIN_PWD=openidm-admin'
- 'IG_URL=https://openig.smoke.forgeops.com/'
- 'AM_URL=https://openam.smoke.forgeops.com/openam'
- 'AM_ADMIN_PWD=password'
entrypoint: 'bash'
args: ['run-smoke-tests.sh']
# Get last username who merged changes into master
# This doesn't work if cloudbuild is launched outside of a git trigger
# - name: 'gcr.io/cloud-builders/git'
# dir: cicd/
# entrypoint: 'bash'
# args: ['last-commit.sh']
# Upload results to GS bucket
- name: 'gcr.io/cloud-builders/gsutil'
dir: 'cicd/forgeops-tests/reports'
args: ['cp', '*', 'gs://forgeops-test-reports/smoke-tests/']
- name: 'gcr.io/engineering-devops/helm'
dir: 'bin/'
entrypoint: 'bash'
args: ['get-logs-from-ns.sh']
- name: 'gcr.io/cloud-builders/gsutil'
dir: 'bin/'
args: ['cp', '-r', 'logs/*', 'gs://forgeops-test-reports/logs/']
# Send slack notifications
# Don't forget to define SLACK_SERVICE in google container builder to receive
# notifications on slack channel
- name: 'gcr.io/cloud-builders/curl'
env:
- 'SLACK_SERVICE=${_SLACK_SERVICE}'
- 'TEST_NAME=Forgeops smoke tests'
- 'TEST_REPORT_LINK=http://smoke-tests.forgeops.com/'
- 'TEST_RESULTS_FILE=forgeops-tests/results.txt'
dir: 'cicd/'
entrypoint: 'bash'
args: ['slack-notify.sh']
# Clean it up
- name: 'gcr.io/engineering-devops/helm'
entrypoint: 'bin/remove-all.sh'
args: ['smoke']
timeout: 1200s
tags: ['smoke', 'tests']