Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
node_modules/
node_modules/
.claude/
8 changes: 4 additions & 4 deletions config/examples/docker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@
"components": [
{
"name": "qubership-kafka-integration-tests",
"file": "integration-tests/docker/Dockerfile",
"dockerfile": "integration-tests/docker/Dockerfile",
"context": "integration-tests",
"changeset": ["integration-tests"]
},
{
"name": "qubership-kafka-crd-init",
"file": "crd-init/docker/Dockerfile",
"dockerfile": "crd-init/docker/Dockerfile",
"context": "crd-init",
"changeset": ["crd-init"]
},
{
"name": "qubership-kafka-operator",
"file": "operator/Dockerfile",
"dockerfile": "operator/Dockerfile",
"context": "operator",
"changeset": ["operator"]
},
{
"name": "qubership-kafka-transfer",
"file": "docker-transfer/kafka/Dockerfile",
"dockerfile": "docker-transfer/kafka/Dockerfile",
"context": ".",
"changeset": [""]
}
Expand Down
57 changes: 16 additions & 41 deletions workflow-templates/docker-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The workflow requires the following inputs:
# - `release`: The release version to publish.
# The workflow requires several configuration files:
# - Docker build configuration file: `.qubership/docker-build-config.cfg`
# - Docker build configuration file: `.qubership/docker.cfg`
# Example: config/examples/docker.cfg
# - GitHub release drafter configuration file: `.github/release-drafter-config.yml`
# Example: config/examples/release-drafter-config.yml
Expand Down Expand Up @@ -43,49 +43,29 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

load-docker-build-components:
needs: [check-tag]
resolve-config:
name: "Load Docker Build Components Configuration"
needs: [check-tag]
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
component: ${{ steps.load_component.outputs.components }}
platforms: ${{ steps.load_component.outputs.platforms }}
env:
CONFIG_FILE: .qubership/docker-build-config.cfg
config: ${{ steps.resolve.outputs.config }}
steps:
- name: "Checkout code"
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- name: "Load Docker Configuration"
id: load_component
run: |
verify=$(cat "$GITHUB_WORKSPACE/${CONFIG_FILE}" | jq '
def verify_structure:
.components as $components
| .platforms as $platforms
| ($components | type == "array")
and (all($components[]; has("name") and has("file") and has("context")))
and ($platforms | type == "string");
verify_structure
| if . then true else false end
')
if [ ${verify} == 'true' ]; then
echo "✅ $GITHUB_WORKSPACE/${CONFIG_FILE} file is valid"
components=$(jq -c ".components" "$GITHUB_WORKSPACE/${CONFIG_FILE}")
platforms=$(jq -c ".platforms" "$GITHUB_WORKSPACE/${CONFIG_FILE}")
else
echo "❗ $GITHUB_WORKSPACE/${CONFIG_FILE} file is invalid"
echo "❗ $GITHUB_WORKSPACE/${CONFIG_FILE} file is invalid" >> $GITHUB_STEP_SUMMARY
exit 1
fi
echo "components=${components}" >> $GITHUB_OUTPUT
echo "platforms=${platforms}" >> $GITHUB_OUTPUT
- name: "Resolve docker config"
id: resolve
uses: netcracker/qubership-workflow-hub/actions/docker-config-resolver@e64a1ee2fc2f68ab44a4ef416c27d83ce36ba8e1 # v2.2.1
with:
file-path: .qubership/docker.cfg

create-tag:
name: "Create Release Tag"
needs: [load-docker-build-components]
needs: [resolve-config]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -102,31 +82,26 @@ jobs:

docker-build:
name: "${{ matrix.component.name }}"
needs: [load-docker-build-components, create-tag]
needs: [resolve-config, create-tag]
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
component: ${{ fromJson(needs.load-docker-build-components.outputs.component) }}
component: ${{ fromJson(needs.resolve-config.outputs.config) }}
steps:
- name: "Get version for current component"
id: get-version
run: |
echo "IMAGE_VERSION=${{ inputs.release }}" >> $GITHUB_ENV

- name: "Docker build and publish"
uses: netcracker/qubership-workflow-hub/actions/docker-action@e64a1ee2fc2f68ab44a4ef416c27d83ce36ba8e1 # v2.2.1
with:
ref: 'v${{ inputs.release }}'
download-artifact: false
dry-run: false
component: ${{ toJson(matrix.component) }}
platforms: ${{ needs.load-docker-build-components.outputs.platforms }}
platforms: ${{ matrix.component.platforms }}
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

github-release:
name: "Github Release"
Expand Down
Loading