diff --git a/.github/actions/build-images/action.yml b/.github/actions/build-images/action.yml index 36dfba611d..9ab7023106 100644 --- a/.github/actions/build-images/action.yml +++ b/.github/actions/build-images/action.yml @@ -28,16 +28,7 @@ runs: env: TAG: ${{ inputs.version }} shell: bash - run: .github/actions/build-images/pack-images.sh - - # push images - - name: Push images - env: - TAG: ${{ inputs.version }} - shell: bash - run: | - export DEFAULT_JDK=11 - .github/actions/build-images/push-images.sh + run: ${{ github.action_path }}/build-images.sh # build/publish support images - name: Publish Grafana Prometheus diff --git a/.github/actions/build-images/build-images.sh b/.github/actions/build-images/build-images.sh new file mode 100755 index 0000000000..e24e9d357e --- /dev/null +++ b/.github/actions/build-images/build-images.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +if [ "$TAG" == "" ]; then + echo "TAG not found" + exit 1 +fi +if [ "$DEFAULT_JDK" = "" ]; then + echo "DEFAULT_JDK not found using 11" + DEFAULT_JDK=11 +else + echo "DEFAULT_JDK=$DEFAULT_JDK" +fi + +function pack_image { + JAR="$1-$TAG.jar" + REPO="$2" + v="$3" + if [ ! -f "$JAR" ]; then + echo "File not found $JAR" + exit 2 + fi + echo "Creating: $REPO:$TAG-jdk$v" + pack build --builder gcr.io/paketo-buildpacks/builder:base \ + --path "$JAR" \ + --env BP_JVM_VERSION=$v "$REPO:$TAG-jdk$v" + RC=$? + if ((RC!=0)); then + echo "Error $RC packaging $JAR" + exit $RC + fi + echo "Created: $REPO:$TAG-jdk$v" +} + +TARGETS=("spring-cloud-dataflow-server/target/spring-cloud-dataflow-server" \ + "spring-cloud-skipper/spring-cloud-skipper-server/target/spring-cloud-skipper-server" \ + "spring-cloud-dataflow-composed-task-runner/target/spring-cloud-dataflow-composed-task-runner" \ + "spring-cloud-dataflow-single-step-batch-job/target/spring-cloud-dataflow-single-step-batch-job" \ + "spring-cloud-dataflow-tasklauncher/spring-cloud-dataflow-tasklauncher-sink-kafka/target/spring-cloud-dataflow-tasklauncher-sink-kafka" \ + "spring-cloud-dataflow-tasklauncher/spring-cloud-dataflow-tasklauncher-sink-rabbit/target/spring-cloud-dataflow-tasklauncher-sink-rabbit") + +IMAGES=("springcloud/spring-cloud-dataflow-server" \ + "springcloud/spring-cloud-skipper-server" \ + "springcloud/spring-cloud-dataflow-composed-task-runner" \ + "springcloud/spring-cloud-dataflow-single-step-batch-job" \ + "springcloud/spring-cloud-dataflow-tasklauncher-sink-kafka" \ + "springcloud/spring-cloud-dataflow-tasklauncher-sink-rabbit") + +len=${#TARGETS[@]} +imageLen=${#IMAGES[@]} +if ((len != imageLen)); then + echo "Expected $len == $imageLen" + exit 1 +fi +for ((i = 0; i < len; i++)); do + for v in 8 11 17; do + TARGET="${TARGETS[i]}" + IMAGE="${IMAGES[i]}" + pack_image $TARGET $IMAGE $v + RC=$? + if [ $RC -ne 0 ]; then + exit $RC + fi + docker push "$IMAGE:$TAG-jdk$v" + echo "Pushed $IMAGE:$TAG-jdk$v" + if [ "$DEFAULT_JDK" == "$v" ]; then + docker tag "$IMAGE:$TAG-jdk$DEFAULT_JDK" "$IMAGE:$TAG" + docker push "$IMAGE:$TAG" + echo "Pushed $IMAGE:$TAG" + fi + done +done diff --git a/.github/actions/build-images/pack-images.sh b/.github/actions/build-images/pack-images.sh deleted file mode 100755 index 6bfc1ca585..0000000000 --- a/.github/actions/build-images/pack-images.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -if [ "$TAG" == "" ]; then - echo "TAG not found" - exit 1 -fi - -function pack_image { - JAR="$1-$TAG.jar" - REPO="$2" - if [ ! -f "$JAR" ]; then - echo "File not found $JAR" - exit 2 - fi - echo "Packaging $JAR" - for v in 8 11 17; do - - echo "Creating: $REPO:$TAG-jdk$v" - pack build --builder gcr.io/paketo-buildpacks/builder:base \ - --path "$JAR" \ - --env BP_JVM_VERSION=$v "$REPO:$TAG-jdk$v" - RC=$? - if ((RC!=0)); then - echo "Error $RC packaging $JAR" - exit $RC - fi - echo "Created: $REPO:$TAG-jdk$v" - done -} - -pack_image "spring-cloud-dataflow-server/target/spring-cloud-dataflow-server" "springcloud/spring-cloud-dataflow-server" -pack_image "spring-cloud-dataflow-composed-task-runner/target/spring-cloud-dataflow-composed-task-runner" "springcloud/spring-cloud-dataflow-composed-task-runner" -pack_image "spring-cloud-dataflow-tasklauncher/spring-cloud-dataflow-tasklauncher-sink-kafka/target/spring-cloud-dataflow-tasklauncher-sink-kafka" "springcloud/spring-cloud-dataflow-tasklauncher-sink-kafka" -pack_image "spring-cloud-dataflow-tasklauncher/spring-cloud-dataflow-tasklauncher-sink-rabbit/target/spring-cloud-dataflow-tasklauncher-sink-rabbit" "springcloud/spring-cloud-dataflow-tasklauncher-sink-rabbit" -pack_image "spring-cloud-dataflow-single-step-batch-job/target/spring-cloud-dataflow-single-step-batch-job" "springcloud/spring-cloud-dataflow-single-step-batch-job" -pack_image "spring-cloud-skipper/spring-cloud-skipper-server/target/spring-cloud-skipper-server" "springcloud/spring-cloud-skipper-server" \ No newline at end of file diff --git a/.github/actions/build-images/push-images.sh b/.github/actions/build-images/push-images.sh deleted file mode 100755 index 295f3cddd0..0000000000 --- a/.github/actions/build-images/push-images.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -if [ "$DEFAULT_JDK" = "" ]; then - echo "DEFAULT_JDK not found using 11" - DEFAULT_JDK=11 -else - echo "DEFAULT_JDK=$DEFAULT_JDK" -fi -if [ "$TAG" == "" ]; then - echo "TAG not found" - exit 1 -fi - -function push_image { - REPO="$1" - echo "Tagging $REPO:$TAG-jdk$DEFAULT_JDK as $REPO:$TAG" - docker tag "$REPO:$TAG-jdk$DEFAULT_JDK" "$REPO:$TAG" - for v in 8 11 17; do - docker push "$REPO:$TAG-jdk$v" - echo "Pushed $REPO:$TAG-jdk$v" - done - docker push "$REPO:$TAG" - echo "Pushed $REPO:$TAG" -} - -push_image "springcloud/spring-cloud-dataflow-server" -push_image "springcloud/spring-cloud-dataflow-composed-task-runner" -push_image "springcloud/spring-cloud-dataflow-tasklauncher-sink-kafka" -push_image "springcloud/spring-cloud-dataflow-tasklauncher-sink-rabbit" -push_image "springcloud/spring-cloud-dataflow-single-step-batch-job" -push_image "springcloud/spring-cloud-skipper-server" diff --git a/.gitignore b/.gitignore index 1d4ba60dc4..5f821b3d31 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,7 @@ workspace/ *.log *.shell /*.json -*.tar \ No newline at end of file +*.tar +/srp +/srp*gz +/observer/*