From cef0924c31f78c3832bfb36d595a34de42537f9d Mon Sep 17 00:00:00 2001 From: Vasily Oleynikov Date: Wed, 18 Dec 2024 20:20:05 +0500 Subject: [PATCH] [CI] Add secondary repo in build and SE+ version (#112) Signed-off-by: v.oleynikov --- .github/workflows/build_prod.yml | 113 ++++++++++++++++++++++++++---- .github/workflows/deploy_prod.yml | 23 ++++++ 2 files changed, 123 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_prod.yml b/.github/workflows/build_prod.yml index 52d497d1..f6f9ec7e 100644 --- a/.github/workflows/build_prod.yml +++ b/.github/workflows/build_prod.yml @@ -8,8 +8,6 @@ env: MODULES_REGISTRY_LOGIN: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }} MODULES_REGISTRY_PASSWORD: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }} MODULES_MODULE_TAG: ${{ github.ref_name }} - # for ex https://user:password@my-repo.com/group - SOURCE_REPO: "${{ secrets.SOURCE_REPO }}" on: push: @@ -23,7 +21,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 @@ -33,8 +31,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] @@ -42,7 +54,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 @@ -52,8 +64,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] @@ -61,7 +87,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 @@ -71,8 +97,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] @@ -90,5 +130,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..2842138b 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