From cef5670afee72dc0e353fca56548bc1c08cc338c Mon Sep 17 00:00:00 2001 From: Vasily Oleynikov Date: Wed, 18 Dec 2024 19:36:23 +0500 Subject: [PATCH] [CI] Add secondary repo in build and SE+ version (#56) Signed-off-by: v.oleynikov --- .github/workflows/build_prod.yml | 113 ++++++++++++++++++++++++++---- .github/workflows/deploy_prod.yml | 23 ++++++ 2 files changed, 124 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_prod.yml b/.github/workflows/build_prod.yml index 50b5e178..54e64c7c 100644 --- a/.github/workflows/build_prod.yml +++ b/.github/workflows/build_prod.yml @@ -24,7 +24,7 @@ jobs: steps: - name: SET VAR run: | - echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/ce/modules" >> "$GITHUB_ENV" + echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/ce/modules" >> "$GITHUB_ENV" - run: | echo $MODULES_REGISTRY echo $MODULES_MODULE_NAME @@ -34,8 +34,22 @@ jobs: name: Show vars - uses: actions/checkout@v4 - - uses: deckhouse/modules-actions/setup@v1 - - uses: deckhouse/modules-actions/build@v1 + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.PROD_REGISTRY }} + registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.DEV_REGISTRY }} + registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/build@v1.2 + with: + module_source: "${{ vars.PROD_REGISTRY }}/${{ vars.PROD_MODULE_SOURCE_NAME }}/ce/modules" + module_name: ${{ vars.MODULE_NAME }} + module_tag: ${{ github.ref_name }} + secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}" prod_ee_setup_build: runs-on: [self-hosted, regular, selectel] @@ -43,7 +57,7 @@ jobs: steps: - name: SET VAR run: | - echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/ee/modules" >> "$GITHUB_ENV" + echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/ee/modules" >> "$GITHUB_ENV" - run: | echo $MODULES_REGISTRY echo $MODULES_MODULE_NAME @@ -53,8 +67,22 @@ jobs: name: Show vars - uses: actions/checkout@v4 - - uses: deckhouse/modules-actions/setup@v1 - - uses: deckhouse/modules-actions/build@v1 + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.PROD_REGISTRY }} + registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.DEV_REGISTRY }} + registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/build@v1.2 + with: + module_source: "${{ vars.PROD_REGISTRY }}/${{ vars.PROD_MODULE_SOURCE_NAME }}/ee/modules" + module_name: ${{ vars.MODULE_NAME }} + module_tag: ${{ github.ref_name }} + secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}" prod_fe_setup_build: runs-on: [self-hosted, regular, selectel] @@ -62,7 +90,7 @@ jobs: steps: - name: SET VAR run: | - echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/fe/modules" >> "$GITHUB_ENV" + echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/fe/modules" >> "$GITHUB_ENV" - run: | echo $MODULES_REGISTRY echo $MODULES_MODULE_NAME @@ -72,8 +100,22 @@ jobs: name: Show vars - uses: actions/checkout@v4 - - uses: deckhouse/modules-actions/setup@v1 - - uses: deckhouse/modules-actions/build@v1 + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.PROD_REGISTRY }} + registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.DEV_REGISTRY }} + registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/build@v1.2 + with: + module_source: "${{ vars.PROD_REGISTRY }}/${{ vars.PROD_MODULE_SOURCE_NAME }}/fe/modules" + module_name: ${{ vars.MODULE_NAME }} + module_tag: ${{ github.ref_name }} + secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}" prod_se_setup_build: runs-on: [self-hosted, regular, selectel] @@ -81,7 +123,7 @@ jobs: steps: - name: SET VAR run: | - echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/se/modules" >> "$GITHUB_ENV" + echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/se/modules" >> "$GITHUB_ENV" - run: | echo $MODULES_REGISTRY echo $MODULES_MODULE_NAME @@ -91,5 +133,52 @@ jobs: name: Show vars - uses: actions/checkout@v4 - - uses: deckhouse/modules-actions/setup@v1 - - uses: deckhouse/modules-actions/build@v1 + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.PROD_REGISTRY }} + registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.DEV_REGISTRY }} + registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/build@v1.2 + with: + module_source: "${{ vars.PROD_REGISTRY }}/${{ vars.PROD_MODULE_SOURCE_NAME }}/se/modules" + module_name: ${{ vars.MODULE_NAME }} + module_tag: ${{ github.ref_name }} + secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}" + + prod_se_plus_setup_build: + runs-on: [self-hosted, regular, selectel] + name: Build and Push SE+ + steps: + - name: SET VAR + run: | + echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/se-plus/modules" >> "$GITHUB_ENV" + - run: | + echo $MODULES_REGISTRY + echo $MODULES_MODULE_NAME + echo $MODULES_MODULE_SOURCE + echo $MODULES_MODULE_TAG + shell: bash + name: Show vars + + - uses: actions/checkout@v4 + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.PROD_REGISTRY }} + registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/setup@v1.2 + with: + registry: ${{ vars.DEV_REGISTRY }} + registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }} + registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }} + - uses: deckhouse/modules-actions/build@v1.2 + with: + module_source: "${{ vars.PROD_REGISTRY }}/${{ vars.PROD_MODULE_SOURCE_NAME }}/se-plus/modules" + module_name: ${{ vars.MODULE_NAME }} + module_tag: ${{ github.ref_name }} + secondary_repo: "${{ vars.DEV_MODULE_SOURCE }}/${{ vars.MODULE_NAME }}" diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml index 73b58d15..29eb8aca 100644 --- a/.github/workflows/deploy_prod.yml +++ b/.github/workflows/deploy_prod.yml @@ -37,6 +37,9 @@ on: se: type: boolean description: SE + se-plus: + type: boolean + description: SE tag: description: "Tag of the module, example v1.21.1" @@ -137,3 +140,23 @@ jobs: chmod +x .github/check_previous_channel_release.sh .github/check_previous_channel_release.sh $MODULES_MODULE_NAME se $RELEASE_CHANNEL $MODULES_MODULE_TAG license-token $MODULES_READ_REGISTRY_PASSWORD - uses: deckhouse/modules-actions/deploy@v1 + + job-SE-plus: + name: Edition SE+ + runs-on: [self-hosted, regular, selectel] + if: github.event.inputs.se-plus == 'true' + steps: + - run: echo "SE+" + - name: SET VAR + run: | + echo "MODULES_MODULE_SOURCE=$MODULES_REGISTRY/$MODULE_SOURCE_NAME/se-plus/modules" >> "$GITHUB_ENV" + - name: ECHO VAR + run: | + echo $MODULES_MODULE_SOURCE + - uses: actions/checkout@v4 + - uses: deckhouse/modules-actions/setup@v1 + - name: Check previous release + run: | + chmod +x .github/check_previous_channel_release.sh + .github/check_previous_channel_release.sh $MODULES_MODULE_NAME se-plus $RELEASE_CHANNEL $MODULES_MODULE_TAG license-token $MODULES_READ_REGISTRY_PASSWORD + - uses: deckhouse/modules-actions/deploy@v1 \ No newline at end of file