Skip to content

Commit 6da5c2b

Browse files
Patrick Stephensedsiper
authored andcommitted
packaging: handle JSON schema upload
Signed-off-by: Patrick Stephens <[email protected]>
1 parent 6c1830c commit 6da5c2b

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

.github/actions/release-server-sync/action.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ runs:
6363
- name: Upload to build server
6464
run: |
6565
ssh $USERNAME@$HOST mkdir -p /home/$USERNAME/apt
66-
rsync --include="*/" --include="*.rpm" --include="*.deb" --exclude="*" -amvz packaging/releases/ $USERNAME@$HOST:/home/$USERNAME/apt
66+
rsync --include="*/" \
67+
--include="*.rpm" \
68+
--include="*.deb" \
69+
--include="*.exe" \
70+
--include="*.zip" \
71+
--include="fluent-bit-schema*.json" \
72+
--exclude="*" -amvz \
73+
packaging/releases/ $USERNAME@$HOST:/home/$USERNAME/apt
6774
env:
6875
HOST: ${{ inputs.server_hostname }}
6976
USERNAME: ${{ inputs.server_username }}

.github/workflows/call-build-images.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ jobs:
318318

319319
- name: Generate schema
320320
run: |
321-
docker run --rm -t ${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }} -J > fluent-bit-schema.json
322-
cat fluent-bit-schema.json | jq -M > fluent-bit-schema-pretty.json
321+
docker run --rm -t ${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }} -J > fluent-bit-schema-${{ inputs.version }}.json
322+
cat fluent-bit-schema.json | jq -M > fluent-bit-schema-pretty-${{ inputs.version }}.json
323323
shell: bash
324324

325325
- name: Upload the schema

.github/workflows/staging-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696

9797
- name: Display structure of downloaded files
9898
run: |
99-
ls -R
99+
ls -R artifacts/
100100
shell: bash
101101

102102
- name: Push schema to S3 bucket

packaging/server/publish-all.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,20 @@ if compgen -G "$SOURCE_DIR/windows/*$VERSION*" > /dev/null; then
122122
echo "Copying Windows artefacts"
123123
# shellcheck disable=SC2086
124124
cp -vf "$SOURCE_DIR"/windows/*$VERSION* /var/www/releases.fluentbit.io/releases/"$MAJOR_VERSION"/
125+
else
126+
echo "Missing Windows builds"
127+
fi
128+
129+
# Handle the JSON schema by copying in the new versions (if they exist) and then updating the symlinks that point at the latest.
130+
if compgen -G "$SOURCE_DIR/fluent-bit-schema*.json" > /dev/null; then
131+
echo "Updating JSON schema"
132+
cp -vf "$SOURCE_DIR"/fluent-bit-schema*.json /var/www/releases.fluentbit.io/releases/"$MAJOR_VERSION/"
133+
134+
# Simpler than 'ln --relative --target-directory=/var/www/releases.fluentbit.io/releases/"$MAJOR_VERSION"'
135+
pushd /var/www/releases.fluentbit.io/releases/"$MAJOR_VERSION"
136+
ln -sf "fluent-bit-schema-$VERSION.json" fluent-bit-schema.json
137+
ln -sf "fluent-bit-schema-pretty-$VERSION.json" fluent-bit-schema-pretty.json
138+
popd
139+
else
140+
echo "Missing JSON schema"
125141
fi

0 commit comments

Comments
 (0)