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
56 changes: 28 additions & 28 deletions config/linters/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
// eslint.config.mjs
import js from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
export default [
{
ignores: [
"dist/**",
]
},
js.configs.recommended,
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
},
plugins: {
"@typescript-eslint": tseslint,
},
rules: {
"no-undef": "warn",
"n/no-missing-import": "warn",
},
},
];
// eslint.config.mjs
import js from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [
{
ignores: [
"dist/**",
]
},

js.configs.recommended,

{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
},
plugins: {
"@typescript-eslint": tseslint,
},
rules: {
"no-undef": "warn",
"n/no-missing-import": "warn",
},
},
];
8 changes: 6 additions & 2 deletions workflow-templates/docker-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# The workflow requires several configuration files:
# - Docker build configuration file: `.qubership/docker.cfg`
# Example: config/examples/docker.cfg
# Full description of configuration file can be found in docs https://github.com/Netcracker/qubership-workflow-hub/tree/main/actions/docker-config-resolver
# - GitHub release drafter configuration file: `.github/release-drafter-config.yml`
# Example: config/examples/release-drafter-config.yml

Expand All @@ -27,6 +28,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CONFIG_FILE: '.qubership/docker.cfg'

jobs:
check-tag:
name: "Check if tag exists"
Expand All @@ -52,7 +56,7 @@ jobs:
outputs:
config: ${{ steps.resolve.outputs.config }}
steps:
- name: "Checkout code"
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
Expand All @@ -61,7 +65,7 @@ jobs:
id: resolve
uses: netcracker/qubership-workflow-hub/actions/docker-config-resolver@e64a1ee2fc2f68ab44a4ef416c27d83ce36ba8e1 # v2.2.1
with:
file-path: .qubership/docker.cfg
file-path: ${{ env.CONFIG_FILE }}

create-tag:
name: "Create Release Tag"
Expand Down
62 changes: 22 additions & 40 deletions workflow-templates/helm-charts-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# Example: config/examples/helm-charts-release-config.yaml
# - Docker build configuration file: `.qubership/docker-build-config.cfg`
# Example: config/examples/docker.cfg
# Full description of configuration file can be found in docs https://github.com/Netcracker/qubership-workflow-hub/tree/main/actions/docker-config-resolver
# - Assets configuration file: `.qubership/assets-config.yml`
# Example: config/examples/assets-config.yml
# - GitHub release drafter configuration file: `.github/release-drafter-config.yml`
Expand All @@ -34,6 +35,11 @@ run-name: ${{ github.repository }} Release ${{ github.event.inputs.release }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CHART_RELEASE_CONFIG_FILE: '.qubership/helm-charts-release-config.yaml'
DOCKER_CONFIG_FILE: '.qubership/docker-build-config.cfg'

jobs:
check-tag:
runs-on: ubuntu-latest
Expand All @@ -48,43 +54,24 @@ jobs:
check-tag: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

load-docker-build-components:
runs-on: ubuntu-latest
permissions:
packages: read
outputs:
component: ${{ steps.load_component.outputs.components }}
platforms: ${{ steps.load_component.outputs.platforms }}
env:
CONFIG_FILE: .qubership/docker-build-config.cfg
packages: ${{ steps.config.outputs.config }}
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Checkout repository
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: Get Configuration File
uses: netcracker/qubership-workflow-hub/actions/docker-config-resolver@e64a1ee2fc2f68ab44a4ef416c27d83ce36ba8e1 #v2.2.1
id: config
with:
file-path: "${{ env.DOCKER_CONFIG_FILE }}"

docker-check-build:
needs: [load-docker-build-components, check-tag]
Expand All @@ -93,21 +80,16 @@ jobs:
strategy:
fail-fast: true
matrix:
component: ${{ fromJson(needs.load-docker-build-components.outputs.component) }}
component: ${{ fromJson(needs.load-docker-build-components.outputs.packages) }}
steps:
- name: Get version for current component
id: get-version
run: |
echo "IMAGE=${{ matrix.component.name }}" >> $GITHUB_ENV
- name: Docker build
uses: netcracker/qubership-workflow-hub/actions/docker-action@5a557213e92e3d22d0292330c4817c82af6704d2 #v2.1.2
with:
ref: ${{ github.ref }}
download-artifact: false
dry-run: true
component: ${{ toJson(matrix.component) }}
platforms: ${{ needs.load-docker-build-components.outputs.platforms }}
tags: "${{ env.IMAGE_VERSION }}"
platforms: ${{ matrix.component.platforms }}
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down Expand Up @@ -138,7 +120,7 @@ jobs:
uses: netcracker/qubership-workflow-hub/actions/charts-values-update-action@5a557213e92e3d22d0292330c4817c82af6704d2 #v2.1.2
with:
release-version: ${{ inputs.release }}
config-file: .qubership/helm-charts-release-config.yaml
config-file: ${{ env.CHART_RELEASE_CONFIG_FILE }}
default-tag: ${{ inputs.release }}
package-charts: true
publish-charts: true
Expand All @@ -160,7 +142,7 @@ jobs:
strategy:
fail-fast: true
matrix:
component: ${{ fromJson(needs.load-docker-build-components.outputs.component) }}
component: ${{ fromJson(needs.load-docker-build-components.outputs.packages) }}
steps:
- name: Get version for current component
id: get-version
Expand All @@ -176,7 +158,7 @@ jobs:
download-artifact: false
dry-run: false
component: ${{ toJson(matrix.component) }}
platforms: ${{ needs.load-docker-build-components.outputs.platforms }}
platforms: ${{ matrix.component.platforms }}
tags: "${{ env.IMAGE_VERSION }},latest"
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down
Loading