/
semaphore.yml
90 lines (82 loc) · 3.03 KB
/
semaphore.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
# 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-ubuntu20-04-amd64-1
fail_fast:
cancel:
when: "true"
execution_time_limit:
hours: 6
queue:
- when: "branch != 'master' and branch !~ '[0-9]+\\.[0-9]+\\.x'"
processing: parallel
global_job_config:
prologue:
commands:
- checkout
- sem-version java 8
blocks:
- name: Test
dependencies: []
run:
# don't run the tests on non-functional changes...
when: "change_in('/', {exclude: ['/.deployed-versions/', '.github/']})"
task:
env_vars:
- name: SEMAPHORE_AGENT_UPLOAD_JOB_LOGS
value: when-trimmed
jobs:
- name: Test
commands:
- . ci-tools ci-update-version
- mvn -Dmaven.gitcommitid.nativegit=true -U -Dmaven.wagon.http.retryHandler.count=10 --batch-mode --no-transfer-progress clean install
epilogue:
always:
commands:
- . publish-test-results
- artifact push workflow target/test-results
- name: Release
dependencies: ["Test"]
run:
when: "branch = 'master' or branch =~ '[0-9]+\\.[0-9]+\\.x'"
task:
jobs:
- name: Release
commands:
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch --unshallow || true
- . ci-tools ci-update-version
- . ci-tools ci-push-tag
- mvn -Ddocker.skip=true -U -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
after_pipeline:
task:
agent:
machine:
type: s1-prod-ubuntu20-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 8
- emit-sonarqube-data -a test-results
- name: Trigger downstream projects
commands:
- >-
if [[ -z "$SEMAPHORE_GIT_PR_BRANCH" ]] && [[ "$SEMAPHORE_PIPELINE_RESULT" == "passed" ]]; then
sem-trigger -p confluent-security-plugins -b $SEMAPHORE_GIT_BRANCH -f .semaphore/semaphore.yml
sem-trigger -p confluent-cloud-plugins -b $SEMAPHORE_GIT_BRANCH -f .semaphore/semaphore.yml
sem-trigger -p cc-docker-ksql -b $SEMAPHORE_GIT_BRANCH -f .semaphore/semaphore.yml
fi