Skip to content

apply service bot changes #537

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

Merged
merged 1 commit into from
Apr 3, 2025
Merged
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
32 changes: 30 additions & 2 deletions .semaphore/cp_dockerfile_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,28 @@ global_job_config:
- export LATEST_TAG=$BRANCH_TAG-latest
- export DOCKER_UPSTREAM_TAG="$LATEST_TAG"
- export DOCKER_REPOS="confluentinc/kafka-streams-examples"
- export COMMUNITY_DOCKER_REPOS=""
- |
if [[ $SKIP_COMMUNITY == "True" ]]; then
# Filter out community repos from DOCKER_REPOS
DOCKER_REPOS=$(comm -23 <(echo "$DOCKER_REPOS" | tr ' ' '\n' | sort) <(echo "$COMMUNITY_DOCKER_REPOS" | tr ' ' '\n' | sort) | tr '\n' ' ' | xargs)
export DOCKER_REPOS
echo "DOCKER_REPOS after skipping community images - $DOCKER_REPOS"

# Set Maven arguments for skipping community modules
export MAVEN_EXTRA_ARGS=""

# Check if current DOCKER_IMAGE is in community repos, skip job execution
for skip_repo in $COMMUNITY_DOCKER_REPOS; do
if [ "$skip_repo" = "$DOCKER_IMAGE" ]; then
echo "Skipping build for $DOCKER_IMAGE as it is in COMMUNITY_DOCKER_REPOS list"
export SEMAPHORE_JOB_RESULT=passed
return 130
Copy link
Preview

Copilot AI Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'return' may be problematic if not within a function context. Replace it with 'exit 130' to ensure the script terminates correctly.

Suggested change
return 130
exit 130

Copilot uses AI. Check for mistakes.

fi
done
else
export MAVEN_EXTRA_ARGS=""
fi
- export DOCKER_DEV_TAG="dev-$BRANCH_TAG-$BUILD_NUMBER"
- export AMD_ARCH=.amd64
- export ARM_ARCH=.arm64
Expand Down Expand Up @@ -107,7 +129,7 @@ blocks:
- export PACKAGING_BUILD_ARGS="$PACKAGING_BUILD_ARGS -DCONFLUENT_PACKAGES_REPO=$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=ubi9
$PACKAGING_BUILD_ARGS -Ddependency.check.skip=true
$PACKAGING_BUILD_ARGS -Ddependency.check.skip=true $MAVEN_EXTRA_ARGS
- . cache-maven store
- >-
for dev_image in $AMD_DOCKER_DEV_FULL_IMAGES;
Expand All @@ -128,6 +150,9 @@ blocks:
task:
jobs:
- name: Deploy AMD confluentinc/kafka-streams-examples ubi9
env_vars:
- name: DOCKER_IMAGE
value: confluentinc/kafka-streams-examples
commands:
- export OS_TAG="-ubi9"
- export PROD_IMAGE_NAME=${DOCKER_PROD_REGISTRY}confluentinc/kafka-streams-examples
Expand Down Expand Up @@ -167,7 +192,7 @@ blocks:
- 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=ubi9
$PACKAGING_BUILD_ARGS -Ddependency.check.skip=true
$PACKAGING_BUILD_ARGS -Ddependency.check.skip=true $MAVEN_EXTRA_ARGS
- . cache-maven store
- for image in $ARM_DOCKER_DEV_FULL_IMAGES; do echo "Pushing $image" && docker push $image; done
epilogue:
Expand All @@ -186,6 +211,9 @@ blocks:
type: s1-prod-ubuntu24-04-arm64-1
jobs:
- name: Deploy ARM confluentinc/kafka-streams-examples ubi9
env_vars:
- name: DOCKER_IMAGE
value: confluentinc/kafka-streams-examples
commands:
- export OS_TAG="-ubi9"
- export PROD_IMAGE_NAME=${DOCKER_PROD_REGISTRY}confluentinc/kafka-streams-examples
Expand Down
20 changes: 20 additions & 0 deletions .semaphore/cp_dockerfile_promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,27 @@ global_job_config:
- docker login --username $DOCKERHUB_USER --password $DOCKERHUB_APIKEY
- export AMD_ARCH=.amd64
- export ARM_ARCH=.arm64
- export COMMUNITY_DOCKER_REPOS=""
- |
if [[ $SKIP_COMMUNITY == "True" ]]; then
for skip_repo in $COMMUNITY_DOCKER_REPOS; do
if [ "$skip_repo" = "$DOCKER_IMAGE" ]; then
echo "Skipping promotion for $DOCKER_IMAGE as it is in COMMUNITY_DOCKER_REPOS list"
export SEMAPHORE_JOB_RESULT=passed
return 130
Copy link
Preview

Copilot AI Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'return' outside of a function may not work as expected. Use 'exit 130' if this command is not part of a function.

Suggested change
return 130
exit 130

Copilot uses AI. Check for mistakes.

fi
done
fi

blocks:
- name: Promote AMD
dependencies: []
task:
jobs:
- name: Promote confluentinc/kafka-streams-examples ubi9 AMD
env_vars:
- name: DOCKER_IMAGE
value: confluentinc/kafka-streams-examples
commands:
- export OS_TYPE="ubi9"
- export DOCKER_REPO="confluentinc/kafka-streams-examples"
Expand Down Expand Up @@ -85,6 +99,9 @@ blocks:
task:
jobs:
- name: Promote confluentinc/kafka-streams-examples ubi9 ARM
env_vars:
- name: DOCKER_IMAGE
value: confluentinc/kafka-streams-examples
commands:
- export OS_TYPE="ubi9"
- export DOCKER_REPO="confluentinc/kafka-streams-examples"
Expand Down Expand Up @@ -117,6 +134,9 @@ blocks:
task:
jobs:
- name: Create Manifest confluentinc/kafka-streams-examples ubi9
env_vars:
- name: DOCKER_IMAGE
value: confluentinc/kafka-streams-examples
commands:
- export OS_TYPE="ubi9"
- if [[ ! "$OS_TYPE" ]]; then export OS_TAG=""; elif [[ "$OS_TYPE" =~ $PROMOTE_OS_TYPE* ]]; then export OS_TAG="-$OS_TYPE"; fi
Expand Down
26 changes: 24 additions & 2 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,28 @@ global_job_config:
- export LATEST_TAG=$BRANCH_TAG-latest
- export DOCKER_UPSTREAM_TAG="$LATEST_TAG"
- export DOCKER_REPOS="confluentinc/kafka-streams-examples"
- export COMMUNITY_DOCKER_REPOS=""
- |
if [[ $SKIP_COMMUNITY == "True" ]]; then
# Filter out community repos from DOCKER_REPOS
DOCKER_REPOS=$(comm -23 <(echo "$DOCKER_REPOS" | tr ' ' '\n' | sort) <(echo "$COMMUNITY_DOCKER_REPOS" | tr ' ' '\n' | sort) | tr '\n' ' ' | xargs)
export DOCKER_REPOS
echo "DOCKER_REPOS after skipping community images - $DOCKER_REPOS"

# Set Maven arguments for skipping community modules
export MAVEN_EXTRA_ARGS=""

# Check if current DOCKER_IMAGE is in community repos, skip job execution
for skip_repo in $COMMUNITY_DOCKER_REPOS; do
if [ "$skip_repo" = "$DOCKER_IMAGE" ]; then
echo "Skipping build for $DOCKER_IMAGE as it is in COMMUNITY_DOCKER_REPOS list"
export SEMAPHORE_JOB_RESULT=passed
return 130
Copy link
Preview

Copilot AI Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'return' outside of a function may cause errors in a shell script. Consider using 'exit 130' if this script block is not within a function.

Suggested change
return 130
exit 130

Copilot uses AI. Check for mistakes.

fi
done
else
export MAVEN_EXTRA_ARGS=""
fi
- export DOCKER_DEV_TAG="dev-$BRANCH_TAG-$BUILD_NUMBER"
- export AMD_ARCH=.amd64
- export ARM_ARCH=.arm64
Expand Down Expand Up @@ -99,7 +121,7 @@ blocks:
- export PACKAGING_BUILD_ARGS="$PACKAGING_BUILD_ARGS -DCONFLUENT_PACKAGES_REPO=$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=ubi9
$PACKAGING_BUILD_ARGS -Ddependency.check.skip=true
$PACKAGING_BUILD_ARGS -Ddependency.check.skip=true $MAVEN_EXTRA_ARGS
- . cache-maven store
- >-
for dev_image in $AMD_DOCKER_DEV_FULL_IMAGES;
Expand Down Expand Up @@ -131,7 +153,7 @@ blocks:
- 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=ubi9
$PACKAGING_BUILD_ARGS -Ddependency.check.skip=true
$PACKAGING_BUILD_ARGS -Ddependency.check.skip=true $MAVEN_EXTRA_ARGS
- . cache-maven store
- for image in $ARM_DOCKER_DEV_FULL_IMAGES; do echo "Pushing $image" && docker push $image; done
epilogue:
Expand Down
16 changes: 16 additions & 0 deletions service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ semaphore:
enable: true
pipeline_type: cp-dockerfile
docker_repos: ['confluentinc/kafka-streams-examples']
community_docker_repos: []
community_maven_modules: []
maven_phase: 'package' # streams examples integration-test needs host-based networking, won't work in CI as-is
maven_skip_deploy: true
build_arm: true
Expand Down Expand Up @@ -44,6 +46,13 @@ semaphore:
- name: CONFLUENT_DEB_VERSION
required: false
default_value: '1'
- name: SKIP_COMMUNITY
required: false
default_value: 'False'
description: 'Skip building community docker images'
options:
- 'True'
- 'False'
- name: cp-dockerfile-promote
branch: master
pipeline_file: .semaphore/cp_dockerfile_promote.yml
Expand All @@ -62,3 +71,10 @@ semaphore:
options:
- 'deb'
- 'ubi'
- name: SKIP_COMMUNITY
required: false
default_value: 'False'
description: 'Skip publishing community docker images'
options:
- 'True'
- 'False'