Добавлен новый рабочий поток для автоматического тестирования с параметрами окружения и настройками сборки.
This commit is contained in:
@@ -0,0 +1,120 @@
|
|||||||
|
name: 'Build Agent'
|
||||||
|
run-name: '${{ inputs.branch }} :: ${{ gitea.run_number }}'
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
test_env:
|
||||||
|
description: 'активное окружение'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: 'test'
|
||||||
|
api_url:
|
||||||
|
description: 'базовый URL DevSpace API'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
ui_url:
|
||||||
|
description: 'базовый URL DevSpace UI'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
backend_url:
|
||||||
|
description: 'backend URL для части API-проверок'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
db_url:
|
||||||
|
description: 'JDBC URL PostgreSQL'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
db_user:
|
||||||
|
description: 'пользователь БД'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: postgres
|
||||||
|
db_password:
|
||||||
|
description: 'пароль БД'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: postgres
|
||||||
|
auth_url:
|
||||||
|
description: 'URL получения токена'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
auth_clientId:
|
||||||
|
description: 'client id'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
auth_grantType:
|
||||||
|
description: 'grant type'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
auth_username:
|
||||||
|
description: 'пользователь для авторизации'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
auth_password:
|
||||||
|
description: 'пароль пользователя'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
generator_url:
|
||||||
|
description: 'URL генератора, нужен для тестов OpenAPI-файлов'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
jobs:
|
||||||
|
deploy-dev:
|
||||||
|
name: 'Deploy to dev'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 'Print Info'
|
||||||
|
run: |
|
||||||
|
echo "Cloning ${{ github.event.inputs.repo_path }}"
|
||||||
|
echo "From branch ${{ github.event.inputs.branch }}"
|
||||||
|
- name: Cloning
|
||||||
|
uses: https://git.binom.pw/otp/devops/clone@main
|
||||||
|
with:
|
||||||
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
repository: 'devspc/devspace-autotests'
|
||||||
|
branch: ${{ github.event.inputs.branch }}
|
||||||
|
- name: 'Конфигурирование интеграции gradle'
|
||||||
|
uses: https://git.binom.pw/otp/devops/config-gradle@main
|
||||||
|
- name: 'Конфигурирование gradle wrapper'
|
||||||
|
uses: https://git.binom.pw/otp/devops/setup-gradle@main
|
||||||
|
- name: Setup Jvm
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: 21
|
||||||
|
distribution: "adopt"
|
||||||
|
- name: Building
|
||||||
|
run: |
|
||||||
|
./gradlew test --no-daemon -x cyclonedxBom \
|
||||||
|
-Dtest.env=${{ input.test_env }} \
|
||||||
|
-Dapi.url=${{ input.api_url }} \
|
||||||
|
-Dui.url=${{ input.ui_url }} \
|
||||||
|
-Dbackend.url=${{ input.backend_url }} \
|
||||||
|
-Ddb.url=${{ input.db_url }} \
|
||||||
|
-Ddb.user=${{ input.db_user }} \
|
||||||
|
-Ddb.password=${{ input.db_password }} \
|
||||||
|
-Dauth.url=${{ input.auth_url }} \
|
||||||
|
-Dauth.clientId=${{ input.auth_clientId }} \
|
||||||
|
-Dauth.grantType=${{ input.auth_grantType }} \
|
||||||
|
-Dauth.username=${{ input.auth_username }} \
|
||||||
|
-Dauth.password=${{ input.auth_password }} \
|
||||||
|
-Dgenerator.url=${{ input.generator_url }}
|
||||||
|
- name: Build and push Docker Image
|
||||||
|
uses: https://git.binom.pw/subochev/devops/build-docker@main
|
||||||
|
with:
|
||||||
|
image_name: "otp/agent"
|
||||||
|
tags: latest ${{ gitea.run_number }}
|
||||||
|
- name: Publishing Helm
|
||||||
|
uses: https://git.binom.pw/subochev/devops/helm-publish@main
|
||||||
|
with:
|
||||||
|
chart_directory: "helm"
|
||||||
|
helm_version: "${{ gitea.run_number }}"
|
||||||
|
helm_version_placeholder: '0.1.0'
|
||||||
|
|
||||||
|
- name: 'Cleanup'
|
||||||
|
if: always()
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo 'Cleaning...'
|
||||||
|
rm -rf ~/.gradle/init.gradle.kts
|
||||||
|
rm -rf ~/.ssh/config
|
||||||
|
rm -rf ~/.ssh/my_key
|
||||||
Reference in New Issue
Block a user