-
Notifications
You must be signed in to change notification settings - Fork 433
Expand file tree
/
Copy pathsemaphore.yml
More file actions
119 lines (111 loc) · 4.85 KB
/
Copy pathsemaphore.yml
File metadata and controls
119 lines (111 loc) · 4.85 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# This file is managed by ServiceBot plugin - Semaphore. The content in this file is created using a common
# template and configurations in service.yml.
# Any modifications made to ths file will be overwritten by the generated content in nightly runs.
# For more information, please refer to the page:
# https://confluentinc.atlassian.net/wiki/spaces/Foundations/pages/2871296194/Add+SemaphoreCI
version: v1.0
name: build-test-release
agent:
machine:
type: s1-prod-ubuntu24-04-amd64-4
fail_fast:
cancel:
when: "true"
execution_time_limit:
hours: 1
queue:
- when: "branch != 'master' and branch !~ '[0-9]+\\.[0-9]+\\.x'"
processing: parallel
global_job_config:
prologue:
commands:
- checkout
- sem-version java 8
- . cache-maven restore
blocks:
- name: Test
dependencies: []
run:
# don't run the tests on non-functional changes...
when: "change_in('/', {exclude: ['/.deployed-versions/', '.github/'], default_branch: 'master'})"
task:
jobs:
- name: Test
commands:
- . sem-pint
- mvn -Dcloud -Pjenkins -U -Ddependency.check.skip=true -Dmaven.wagon.http.retryHandler.count=10 --batch-mode --no-transfer-progress clean verify install dependency:analyze validate
- export TRIVY_DISABLE_VEX_NOTICE=true
- trivy version
- echo "Check go/connector-dev-vuln-remediation for fixing or suppressing vulnerabilities found by trivy"
- trivy --skip-files "*.zip" rootfs --scanners vuln --db-repository public.ecr.aws/aquasecurity/trivy-db --java-db-repository public.ecr.aws/aquasecurity/trivy-java-db --ignore-unfixed --ignorefile
.trivyignore --exit-code 1 --severity CRITICAL target/components/packages
- trivy --skip-files "*.zip" rootfs --scanners vuln --db-repository public.ecr.aws/aquasecurity/trivy-db --java-db-repository public.ecr.aws/aquasecurity/trivy-java-db --ignore-unfixed --ignorefile
.trivyignore --severity HIGH,LOW,MEDIUM target/components/packages
- . cache-maven store
epilogue:
always:
commands:
- . publish-test-results
- artifact push workflow target/test-results
- artifact push workflow target
- name: Release
dependencies: ["Test"]
run:
when: "branch = 'master' or branch =~ '[0-9]+\\.[0-9]+\\.x'"
task:
jobs:
- name: Release
commands:
- mvn -Dcloud -Pjenkins -U -Ddependency.check.skip=true -Dmaven.wagon.http.retryHandler.count=10 --batch-mode -DaltDeploymentRepository=confluent-codeartifact-internal::default::https://confluent-519856050701.d.codeartifact.us-west-2.amazonaws.com/maven/maven-snapshots/
-DrepositoryId=confluent-codeartifact-internal deploy -DskipTests
- name: Release Notes
dependencies: []
run:
when: "branch =~ '[0-9]+\\.[0-9]+\\.x'"
task:
jobs:
- name: Generate Release Notes
commands:
- git clone --branch master --single-branch git@github.com:confluentinc/connect-releases.git
- ./connect-releases/tasks/release-connect-plugins/generate-connect-changelogs.sh
# This is auto-managed by connect-ci-cd-pipelines semaphore task, to disable please reach out on slack #connect-testability
- name: Connector Kafka Docker Playground Test
dependencies: []
run:
# Run this block only for pull requests
when: "pull_request =~ '.*'"
task:
jobs:
- name: Trigger Kafka Docker Playground Test
commands:
# Don't run this block if target branch for PR is not a nightly branch or master branch
- |
if [[ "$SEMAPHORE_GIT_BRANCH" =~ ^[0-9]+\.[0-9]+\.x$ ]] || [[ "$SEMAPHORE_GIT_BRANCH" == "master" ]] ; then \
echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is feature or master branch. Triggering run-kdp-matrix-on-pr-builds task."; \
sem-trigger -p connect-ci-cd-pipelines \
-t run-kdp-matrix-on-pr-builds \
-b master \
-i "REPO_NAME:$(basename $SEMAPHORE_GIT_REPO_SLUG)" \
-i "BRANCH_NAME:${SEMAPHORE_GIT_PR_BRANCH}" \
-w
else \
echo "PR is targeted to ${SEMAPHORE_GIT_BRANCH} branch which is not feature or master branch. Skipping Kafka Docker Playground Test Task."; \
fi;
after_pipeline:
task:
agent:
machine:
type: s1-prod-ubuntu24-04-arm64-0
jobs:
- name: Metrics
commands:
- emit-ci-metrics -p -a test-results
- name: Publish Test Results
commands:
- test-results gen-pipeline-report
- name: SonarQube
commands:
- checkout
- sem-version java 11
- artifact pull workflow target
- emit-sonarqube-data --run_only_sonar_scan