Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore service bot update 2 test #290

Draft
wants to merge 21 commits into
base: 6.2.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
662 changes: 662 additions & 0 deletions .semaphore/cp_dockerfile_build.yml

Large diffs are not rendered by default.

764 changes: 764 additions & 0 deletions .semaphore/cp_dockerfile_promote.yml

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions .semaphore/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This file is managed by ServiceBot plugin - Semaphore. The content in this file is created using a common
# template and configurations in service.yml.
# Modifications in this file will be overwritten by generated content in the nightly run.
# For more information, please refer to the page:
# https://confluentinc.atlassian.net/wiki/spaces/Foundations/pages/2871296194/Add+SemaphoreCI
apiVersion: v1alpha
kind: Project
metadata:
name: kafka-images
description: ""
spec:
visibility: private
repository:
url: [email protected]:confluentinc/kafka-images.git
run_on:
- branches
- tags
- pull_requests
pipeline_file: .semaphore/semaphore.yml
integration_type: github_app
status:
pipeline_files:
- path: .semaphore/semaphore.yml
level: pipeline
whitelist:
branches:
- master
- main
- /^v\d+\.\d+\.x$/
- /^gh-readonly-queue.*/
custom_permissions: true
debug_permissions:
- empty
- default_branch
- non_default_branch
- pull_request
- forked_pull_request
- tag
attach_permissions:
- default_branch
- non_default_branch
- pull_request
- forked_pull_request
- tag
157 changes: 157 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# 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: 1

queue:
- when: "branch != 'master' and branch !~ '[0-9]+\\.[0-9]+\\.[0-9]+'"
processing: parallel

global_job_config:
prologue:
commands:
- checkout
- sem-version java 8
- . vault-setup
- . cache-maven restore
- pip install tox==3.28.0
- export GIT_COMMIT=$(git rev-parse --verify HEAD --short)
- export BUILD_NUMBER=$(echo $SEMAPHORE_WORKFLOW_ID | cut -f1 -d"-")
- export BRANCH_TAG=$(echo $SEMAPHORE_GIT_BRANCH | tr / -)
# For PR Builds using Packaging
- pip install confluent-release-tools
- if [ $BRANCH_TAG == "master" ]; then export BUILD_KEY=$(pinto get-master-version); else export BUILD_KEY=$BRANCH_TAG; fi
- export LATEST_PACKAGING_BUILD_NUMBER=$(aws s3 ls s3://jenkins-confluent-packages/$BRANCH_TAG/ --no-paginate --recursive | grep "$BRANCH_TAG/[0-9]" | sort | tail -n 1 | awk '{print $4}' | awk -F
/ '{print $2}')
- export CONFLUENT_VERSION=$(pinto get-version --build $BUILD_KEY --key confluent.version)
- export DEFAULT_OS_TYPE="ubi"
- export URL_CONFLUENT_VERSION=$(echo $CONFLUENT_VERSION | awk -F . '{print $1"."$2}')
- export PACKAGES_URL="https://s3-us-west-2.amazonaws.com/jenkins-confluent-packages/$BRANCH_TAG/$LATEST_PACKAGING_BUILD_NUMBER/PACKAGE_TYPE/$URL_CONFLUENT_VERSION"
- export PACKAGING_BUILD_NUMBER=$LATEST_PACKAGING_BUILD_NUMBER
- >-
if [[ $IS_BETA || $IS_HOTFIX || $IS_POST ]]; then
export PLATFORM_LABEL=$(echo $BRANCH_TAG | awk -F - '{print "~"$2}')
elif [[ ! $IS_RELEASE ]]; then
export PLATFORM_LABEL="~SNAPSHOT"
else
export PLATFORM_LABEL=""
fi
- export PACKAGING_BUILD_ARGS=" -DCONFLUENT_VERSION=$CONFLUENT_VERSION -DCONFLUENT_PLATFORM_LABEL=$PLATFORM_LABEL -DCONFLUENT_DEB_VERSION=$CONFLUENT_DEB_VERSION -DALLOW_UNSIGNED=$ALLOW_UNSIGNED"
- >-
if [[ $IS_RELEASE && $PACKAGING_BUILD_NUMBER ]]; then
if [[ $IS_BETA ]]; then
export MAVEN_PACKAGES_URL="https://s3.us-west-2.amazonaws.com/jenkins-confluent-packages-beta-maven/$BRANCH_TAG/$PACKAGING_BUILD_NUMBER/maven"
elif [[ $IS_PREVIEW ]]; then
export MAVEN_PACKAGES_URL="https://s3.us-west-2.amazonaws.com/jenkins-confluent-packages-alpha-maven/$BRANCH_NAME/$PACKAGING_BUILD_NUMBER/maven"
elif [[ $IS_RC ]]; then
export MAVEN_PACKAGES_URL="https://s3.us-west-2.amazonaws.com/staging-confluent-packages-maven/v$BRANCH_NAME/maven"
if [[ $PACKAGES_MAVEN_URL ]]; then
export MAVEN_PACKAGES_URL=$PACKAGES_MAVEN_URL
fi
fi
# Overwrite maven global configuration
. vault-sem-get-secret maven-settings-cp-dockerfile
else
echo "This job is not a isBetaJob, isPreviewJob, isHotfixJob, or isRcJob (What we know how to handle) - and we don't know how to handle it"
fi
- export DOCKER_DEV_REGISTRY="519856050701.dkr.ecr.us-west-2.amazonaws.com/docker/dev/"
- export DOCKER_PROD_REGISTRY="519856050701.dkr.ecr.us-west-2.amazonaws.com/docker/prod/"
- export DOCKER_UPSTREAM_REGISTRY=$DOCKER_PROD_REGISTRY
- export LATEST_TAG=$BRANCH_TAG-latest
- export DOCKER_UPSTREAM_TAG="$LATEST_TAG"
- export DOCKER_REPOS="confluentinc/cp-server-connect confluentinc/cp-server-connect-base confluentinc/cp-kafka-connect confluentinc/cp-kafka-connect-base confluentinc/cp-enterprise-kafka confluentinc/cp-kafka
confluentinc/confluent-local confluentinc/cp-server confluentinc/cp-zookeeper"
- export DOCKER_DEV_TAG="dev-$BRANCH_TAG-$BUILD_NUMBER"
- export AMD_ARCH=.amd64
- export ARM_ARCH=.arm64
blocks:
- name: Build, Test, & Scan AMD
dependencies: []
run:
when: "pull_request =~ '.*'"
task:
jobs:
- name: Build, Test, & Scan ubi8
commands:
- export OS_TAG="-ubi8"
- export DOCKER_DEV_FULL_IMAGES=$DOCKER_DEV_REGISTRY${DOCKER_REPOS// /:$DOCKER_DEV_TAG$OS_TAG $DOCKER_DEV_REGISTRY}:$DOCKER_DEV_TAG$OS_TAG
- export AMD_DOCKER_DEV_FULL_IMAGES=${DOCKER_DEV_FULL_IMAGES// /$AMD_ARCH }$AMD_ARCH
- ci-tools ci-update-version
- export OS_PACKAGES_URL=$(echo "$PACKAGES_URL" | sed "s/PACKAGE_TYPE/rpm/g")
- export PACKAGING_BUILD_ARGS="$PACKAGING_BUILD_ARGS -DCONFLUENT_PACKAGES_REPO=$OS_PACKAGES_URL"
- mvn -Dmaven.wagon.http.retryHandler.count=3 --batch-mode -P jenkins,docker clean package dependency:analyze validate -U -Ddocker.registry=$DOCKER_DEV_REGISTRY -Ddocker.upstream-registry=$DOCKER_UPSTREAM_REGISTRY
-DBUILD_NUMBER=$BUILD_NUMBER -DGIT_COMMIT=$GIT_COMMIT -Ddocker.tag=$DOCKER_DEV_TAG$OS_TAG$AMD_ARCH -Ddocker.upstream-tag=$DOCKER_UPSTREAM_TAG$OS_TAG -Darch.type=$AMD_ARCH -Ddocker.os_type=ubi8
$PACKAGING_BUILD_ARGS
- . cache-maven store
- >-
for dev_image in $AMD_DOCKER_DEV_FULL_IMAGES;
do
cve-scan $dev_image
done
- for image in $AMD_DOCKER_DEV_FULL_IMAGES; do echo "Pushing $image" && docker push $image; done
epilogue:
always:
commands:
- . publish-test-results
- artifact push workflow target/test-results
- artifact push workflow target --destination target-AMD
- name: Build & Test ARM
dependencies: []
run:
when: "pull_request =~ '.*'"
task:
agent:
machine:
type: s1-prod-ubuntu20-04-arm64-1
jobs:
- name: Build & Test ubi8
commands:
- export OS_TAG="-ubi8"
- export DOCKER_DEV_FULL_IMAGES=$DOCKER_DEV_REGISTRY${DOCKER_REPOS// /:$DOCKER_DEV_TAG$OS_TAG $DOCKER_DEV_REGISTRY}:$DOCKER_DEV_TAG$OS_TAG
- export ARM_DOCKER_DEV_FULL_IMAGES=${DOCKER_DEV_FULL_IMAGES// /$ARM_ARCH }$ARM_ARCH
- export OS_PACKAGES_URL=$(echo "$PACKAGES_URL" | sed "s/PACKAGE_TYPE/rpm/g")
- export PACKAGING_BUILD_ARGS="$PACKAGING_BUILD_ARGS -DCONFLUENT_PACKAGES_REPO=$OS_PACKAGES_URL"
- ci-tools ci-update-version
- mvn -Dmaven.wagon.http.retryHandler.count=3 --batch-mode -P jenkins,docker clean package dependency:analyze validate -U -Ddocker.registry=$DOCKER_DEV_REGISTRY -Ddocker.upstream-registry=$DOCKER_UPSTREAM_REGISTRY
-DBUILD_NUMBER=$BUILD_NUMBER -DGIT_COMMIT=$GIT_COMMIT -Ddocker.tag=$DOCKER_DEV_TAG$OS_TAG$ARM_ARCH -Ddocker.upstream-tag=$DOCKER_UPSTREAM_TAG$OS_TAG -Darch.type=$ARM_ARCH -Ddocker.os_type=ubi8
$PACKAGING_BUILD_ARGS
- . cache-maven store
- for image in $ARM_DOCKER_DEV_FULL_IMAGES; do echo "Pushing $image" && docker push $image; done
epilogue:
always:
commands:
- . publish-test-results
- artifact push workflow target/test-results
- artifact push workflow target --destination target-ARM
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 11
- artifact pull workflow target-AMD
- artifact pull workflow target-ARM
- emit-sonarqube-data --run_only_sonar_scan
4 changes: 2 additions & 2 deletions ce-kafka/Dockerfile.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG DOCKER_UPSTREAM_REGISTRY
ARG DOCKER_REGISTRY
ARG DOCKER_UPSTREAM_TAG=ubi8-latest
ARG DOCKER_TAG

FROM ${DOCKER_UPSTREAM_REGISTRY}confluentinc/cp-kafka:${DOCKER_TAG}
FROM ${DOCKER_REGISTRY}confluentinc/cp-kafka:${DOCKER_TAG}

ARG PROJECT_VERSION
ARG ARTIFACT_ID
Expand Down
4 changes: 2 additions & 2 deletions kafka-connect-base/Dockerfile.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG DOCKER_UPSTREAM_REGISTRY
ARG DOCKER_REGISTRY
ARG DOCKER_UPSTREAM_TAG=ubi8-latest
ARG DOCKER_TAG

FROM ${DOCKER_UPSTREAM_REGISTRY}confluentinc/cp-kafka:${DOCKER_TAG}
FROM ${DOCKER_REGISTRY}confluentinc/cp-kafka:${DOCKER_TAG}

ARG PROJECT_VERSION
ARG ARTIFACT_ID
Expand Down
4 changes: 2 additions & 2 deletions kafka-connect/Dockerfile.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG DOCKER_UPSTREAM_REGISTRY
ARG DOCKER_REGISTRY
ARG DOCKER_UPSTREAM_TAG=ubi8-latest
ARG DOCKER_TAG

FROM ${DOCKER_UPSTREAM_REGISTRY}confluentinc/cp-kafka-connect-base:${DOCKER_TAG}
FROM ${DOCKER_REGISTRY}confluentinc/cp-kafka-connect-base:${DOCKER_TAG}

ARG PROJECT_VERSION
ARG ARTIFACT_ID
Expand Down
4 changes: 2 additions & 2 deletions server-connect-base/Dockerfile.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG DOCKER_UPSTREAM_REGISTRY
ARG DOCKER_REGISTRY
ARG DOCKER_UPSTREAM_TAG=ubi8-latest
ARG DOCKER_TAG

FROM ${DOCKER_UPSTREAM_REGISTRY}confluentinc/cp-server:${DOCKER_TAG}
FROM ${DOCKER_REGISTRY}confluentinc/cp-server:${DOCKER_TAG}

ARG PROJECT_VERSION
ARG ARTIFACT_ID
Expand Down
4 changes: 2 additions & 2 deletions server-connect/Dockerfile.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG DOCKER_UPSTREAM_REGISTRY
ARG DOCKER_REGISTRY
ARG DOCKER_UPSTREAM_TAG=ubi8-latest
ARG DOCKER_TAG

FROM ${DOCKER_UPSTREAM_REGISTRY}confluentinc/cp-server-connect-base:${DOCKER_TAG}
FROM ${DOCKER_REGISTRY}confluentinc/cp-server-connect-base:${DOCKER_TAG}

ARG PROJECT_VERSION
ARG ARTIFACT_ID
Expand Down
5 changes: 5 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### service-bot sonarqube plugin managed file
sonar.coverage.exclusions=**/test/**/*,**/tests/**/*,**/mock/**/*,**/mocks/**/*,**/*mock*,**/*test*
sonar.exclusions=**/*.pb.*,**/mk-include/**/*
sonar.projectKey=kafka-images
sonar.sources=.