Skip to content

Commit

Permalink
[CI] Add secondary repo in build and SE+ version (#112)
Browse files Browse the repository at this point in the history
Signed-off-by: v.oleynikov <[email protected]>
  • Loading branch information
duckhawk authored Dec 18, 2024
1 parent e61684e commit cef0924
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 13 deletions.
113 changes: 100 additions & 13 deletions .github/workflows/build_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]/group
SOURCE_REPO: "${{ secrets.SOURCE_REPO }}"

on:
push:
Expand All @@ -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
Expand All @@ -33,16 +31,30 @@ jobs:
name: Show vars
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1
- uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
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]
name: Build and Push EE
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
Expand All @@ -52,16 +64,30 @@ jobs:
name: Show vars
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1
- uses: deckhouse/modules-actions/build@v1
- uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
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]
name: Build and Push FE
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
Expand All @@ -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/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
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]
Expand All @@ -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/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
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/[email protected]
with:
registry: ${{ vars.PROD_REGISTRY }}
registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
with:
registry: ${{ vars.DEV_REGISTRY }}
registry_login: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
registry_password: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
- uses: deckhouse/modules-actions/[email protected]
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 }}"
23 changes: 23 additions & 0 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

0 comments on commit cef0924

Please sign in to comment.