Skip to content

Commit

Permalink
Fix build-images.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
corneil committed Oct 12, 2023
1 parent 85e3557 commit 281a45e
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 239 deletions.
36 changes: 5 additions & 31 deletions .github/actions/build-images/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,11 @@ function pack_image {
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")

MAVEN_ARTIFACT_IDS=("spring-cloud-dataflow-server" \
"spring-cloud-dataflow-server" \
"spring-cloud-dataflow-composed-task-runner" \
"spring-cloud-dataflow-tasklauncher-sink-kafka" \
"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
TARGET="${TARGETS[i]}"
IMAGE="${IMAGES[i]}"
ARTIFACT_ID="${MAVEN_ARTIFACT_IDS[i]}"
LEN=$(jq '.include | length' .github/workflows/images.json)
for ((i = 0; i < LEN; i++)); do
TARGET="$(jq -r --arg index $i '.include[$index | tonumber] | .path' .github/workflows/images.json)"
IMAGE="$(jq -r --arg index $i '.include[$index | tonumber ] | .image' .github/workflows/images.json)"
ARTIFACT_ID="$(jq -r --arg index $i '.include[$index | tonumber ] | .name' .github/workflows/images.json)"
for v in 8 11 17 21; do
pack_image $TARGET $IMAGE $v $ARTIFACT_ID
RC=$?
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/images.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"path": "spring-cloud-dataflow-composed-task-runner/target",
"image": "springcloud/spring-cloud-dataflow-composed-task-runner"
},
{
"name": "spring-cloud-dataflow-single-step-batch-job",
"path": "spring-cloud-dataflow-single-step-batch-job/target",
"image": "springcloud/spring-cloud-dataflow-single-step-batch-job"
},
{
"name": "spring-cloud-dataflow-tasklauncher-sink-kafka",
"path": "spring-cloud-dataflow-tasklauncher/spring-cloud-dataflow-tasklauncher-sink-kafka/target",
Expand Down
204 changes: 107 additions & 97 deletions .github/workflows/release-controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,101 +14,111 @@ jobs:
runs-on: ubuntu-latest
steps:

# initial is when user starts workflow from UI(context is empty)
# then train build goes through via repos using defined hander rules
- name: Handle Zoo Control
uses: jvalkeal/[email protected]
with:
dispatch-handler-token: ${{ secrets.SCDF_ACCESS_TOKEN }}
dispatch-handler-max: 20
dispatch-handler-config: >
[
{
"if": "initial == true",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-deployer",
"ref": "main",
"workflow": "release-worker.yml"
# initial is when user starts workflow from UI(context is empty)
# then train build goes through via repos using defined hander rules
- name: Handle Zoo Control
uses: jvalkeal/[email protected]
with:
dispatch-handler-token: ${{ secrets.SCDF_ACCESS_TOKEN }}
dispatch-handler-max: 20
dispatch-handler-config: >
[
{
"if": "initial == true",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-deployer",
"ref": "main",
"workflow": "release-worker.yml"
}
},
{
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-deployer' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow-ui",
"ref": "main",
"workflow": "release-worker.yml"
}
},
{
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-dataflow-ui' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "release-worker.yml"
}
},
{
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "carvel-worker.yml"
}
},
{
"if": "data.event == 'carvel-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "promote-release.yml"
}
},
{
"if": "data.event == 'promote-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "central-release.yml"
}
},
{
"if": "data.event == 'central-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "github-release.yml"
}
},
{
"if": "data.event == 'promotion-failed'",
"action": "fail",
"fail": {
"message": "artifactory promotion failed"
}
},
{
"if": "data.event == 'central-failed'",
"action": "fail",
"fail": {
"message": "central sync failed"
}
},
{
"if": "data.event == 'ghrelease-failed'",
"action": "fail",
"fail": {
"message": "github release failed"
}
},
{
"if": "data.event == 'build-failed'",
"action": "fail",
"fail": {
"message": "something went wrong in build train"
}
}
},
{
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-deployer' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow-ui",
"ref": "main",
"workflow": "release-worker.yml"
}
},
{
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-dataflow-ui' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "release-worker.yml"
}
},
{
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "promote-release.yml"
}
},
{
"if": "data.event == 'promote-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "central-release.yml"
}
},
{
"if": "data.event == 'central-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "github-release.yml"
}
},
{
"if": "data.event == 'promotion-failed'",
"action": "fail",
"fail": {
"message": "artifactory promotion failed"
}
},
{
"if": "data.event == 'central-failed'",
"action": "fail",
"fail": {
"message": "central sync failed"
}
},
{
"if": "data.event == 'ghrelease-failed'",
"action": "fail",
"fail": {
"message": "github release failed"
}
},
{
"if": "data.event == 'build-failed'",
"action": "fail",
"fail": {
"message": "something went wrong in build train"
}
}
]
]
Loading

0 comments on commit 281a45e

Please sign in to comment.