Skip to content

Commit

Permalink
add transform to handle version with dash
Browse files Browse the repository at this point in the history
Signed-off-by: Mark McCormick <[email protected]>
  • Loading branch information
mamccorm committed Mar 2, 2024
1 parent 772eb35 commit ec5a839
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions confluent-kafka.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package:
description: Community edition of Confluent Kafka.
copyright:
- license: Apache-2.0

dependencies:
runtime:
- bash # Requied by this images - uses shell to launch image wth zookeeper.
Expand All @@ -21,11 +20,20 @@ environment:
- openjdk-11
- sbt

# Upstream uses a '-' in the version. We have to strip that out in the update block for
# the package version (which doesn't support '-'). However we need to convert it back
# for use within other areas in the script.
var-transforms:
- from: ${{package.version}}
match: "_"
replace: "-"
to: mangled-package-version

pipeline:
- uses: git-checkout
with:
repository: https://github.com/confluentinc/kafka
tag: v${{package.version}}-ccs
tag: v${{vars.mangled-package-version}}-ccs
expected-commit: ab63fe9ca0e7bfa1011e2101bfa891684f392c0d

- runs: |
Expand All @@ -34,14 +42,13 @@ pipeline:
gradle clean releaseTarGz
nohup /usr/lib/kafka/bin/zookeeper-server-start.sh /usr/lib/kafka/config/zookeeper.properties > ${{targets.destdir}}/usr/lib/kafka/logs/zookeeper.out 2> zookeeper.err < /dev/null &
# Example filename: 'kafka_2.13-7.7.0-301-ccs.tgz'
tar -xzvf core/build/distributions/kafka_*-${{package.version}}-ccs.tgz
tar -xzvf core/build/distributions/kafka_*-${{vars.mangled-package-version}}-ccs.tgz
mkdir -p ${{targets.destdir}}/usr/lib/kafka/logs
mv kafka_*-${{package.version}}-ccs/bin ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{package.version}}-ccs/libs ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{package.version}}-ccs/config ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{vars.mangled-package-version}}-ccs/bin ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{vars.mangled-package-version}}-ccs/libs ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{vars.mangled-package-version}}-ccs/config ${{targets.destdir}}/usr/lib/kafka
# Clean up windows
rm -rf ${{targets.destdir}}/usr/lib/kafka/bin/*.bat
Expand Down

0 comments on commit ec5a839

Please sign in to comment.