Skip to content

feat(core): add chart-values HTTP service #358

feat(core): add chart-values HTTP service

feat(core): add chart-values HTTP service #358

Workflow file for this run

name: Build and Push for Dev
on:
workflow_dispatch:
inputs:
pr_number:
description: |
Pull request number, like 563, or leave empty and choose a branch
For branches main, release-*, tag will be generated as branch name
required: false
type: number
svace_enabled:
description: "Enable svace build"
type: boolean
required: false
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
push:
branches:
- main
- release-*
tags:
- "v*"
env:
TASK_X_REMOTE_TASKFILES: 1
jobs:
build_dev:
runs-on: [self-hosted, large]
name: Build and Push images
outputs:
modules_module_tag: ${{ steps.modules_module_tag.outputs.MODULES_MODULE_TAG }}
steps:
- name: Set vars
id: modules_module_tag
run: |
if [[ "${{ github.ref_name }}" == 'main' ]]; then
MODULES_MODULE_TAG="${{ github.ref_name }}"
elif [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+ ]]; then
MODULES_MODULE_TAG="${{ github.ref_name }}"
elif [[ -n "${{ github.event.pull_request.number }}" ]]; then
MODULES_MODULE_TAG="pr${{ github.event.pull_request.number }}"
elif [[ -n "${{ github.event.inputs.pr_number }}" ]]; then
MODULES_MODULE_TAG="pr${{ github.event.inputs.pr_number }}"
else
echo "::error title=Module image tag is required::Can't detect module tag from workflow context. Dev build uses branch name as tag for main and release branches, and PR number for builds from pull requests. Check workflow for correctness."
exit 1
fi
echo "MODULES_MODULE_TAG=$MODULES_MODULE_TAG" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v6
- uses: deckhouse/modules-actions/setup@main
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/build@main
with:
module_source: dev-registry.deckhouse.io/sys/deckhouse-oss/modules
module_name: ${{ vars.MODULES_MODULE_NAME }}
module_tag: ${{ steps.modules_module_tag.outputs.MODULES_MODULE_TAG }}
svace_enabled: false
show_dev_manifest:
runs-on: [self-hosted, large]
name: Show manifest
needs: build_dev
steps:
- name: Show dev config
run: |
cat << OUTER
Create ModuleConfig and ModulePullOverride resources to test this MR:
cat <<EOF | kubectl apply -f -
---
apiVersion: deckhouse.io/v1alpha1
kind: ModulePullOverride
metadata:
name: ${{ vars.MODULES_MODULE_NAME }}
spec:
imageTag: ${{ needs.build_dev.outputs.modules_module_tag }}
source: deckhouse
---
apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
name: ${{ vars.MODULES_MODULE_NAME }}
spec:
enabled: true
EOF
Or patch an existing ModulePullOverride:
kubectl patch mpo ${{ vars.MODULES_MODULE_NAME }} --type merge -p '{"spec":{"imageTag":"${{ needs.build_dev.outputs.modules_module_tag }}"}}'
OUTER
cve_scan_on_pr:
name: Trivy images check
needs:
- build_dev
uses: ./.github/workflows/cve_scan_reusable.yml
with:
source_tag: ${{ needs.build_dev.outputs.modules_module_tag }}
external_module_name: ${{ vars.MODULES_MODULE_NAME }}
e2e_tests:
name: Run e2e tests
runs-on: [self-hosted, large]
needs: build_dev
steps:
- uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
cache: true
go-version-file: tests/e2e/go.mod
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install ginkgo
run: task --yes deps:install:e2e
- name: Setup kind with module operator-helm enabled
run: task --yes -p test:e2e:setup
env:
KIND_CLUSTER_NAME: d8-operator-helm-${{ github.run_number }}
DEV_REGISTRY_DOCKER_CONFIG: ${{ secrets.DEV_REGISTRY_DOCKER_CONFIG }}
- name: Run e2e tests
run: task --yes -p test:e2e
env:
KIND_CLUSTER_NAME: d8-operator-helm-${{ github.run_number }}
DEV_REGISTRY_DOCKER_CONFIG: ${{ secrets.DEV_REGISTRY_DOCKER_CONFIG }}
E2E_MODULE_TAG_NAME: ${{ needs.build_dev.outputs.modules_module_tag }}
E2E_MODULE_SOURCE: operator-helm
- name: Delete kind cluster
run: task --yes -p test:e2e:cleanup
env:
KIND_CLUSTER_NAME: d8-operator-helm-${{ github.run_number }}
if: always()
notify:
if: |
always() && (
(github.event_name == 'pull_request' && github.event.pull_request.draft == false && failure()) ||
(github.event_name != 'pull_request' && failure())
)
needs:
- build_dev
- e2e_tests
uses: werf/common-ci/.github/workflows/notification.yml@main
secrets:
loopNotificationGroup: ${{ secrets.LOOP_NOTIFICATION_GROUP }}
webhook: ${{ secrets.LOOP_NOTIFICATION_WEBHOOK }}
notificationChannel: ${{ secrets.LOOP_NOTIFICATION_CHANNEL }}