Skip to content

Commit

Permalink
[CI] Fixed runners and added dev registry cleanup (#78)
Browse files Browse the repository at this point in the history
Signed-off-by: v.oleynikov <[email protected]>
  • Loading branch information
duckhawk authored Jul 30, 2024
1 parent c8329bc commit f9b3bd0
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

jobs:
dev_setup_build:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Build and Push images
steps:
- name: Set vars for PR
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

jobs:
prod_ce_setup_build:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Build and Push CE
steps:
- name: SET VAR
Expand All @@ -37,7 +37,7 @@ jobs:
- uses: deckhouse/modules-actions/build@v1

prod_ee_setup_build:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Build and Push EE
steps:
- name: SET VAR
Expand All @@ -56,7 +56,7 @@ jobs:
- uses: deckhouse/modules-actions/build@v1

prod_fe_setup_build:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Build and Push FE
steps:
- name: SET VAR
Expand All @@ -75,7 +75,7 @@ jobs:
- uses: deckhouse/modules-actions/build@v1

prod_se_setup_build:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Build and Push SE
steps:
- name: SET VAR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
release-label:
name: Release note label
runs-on: ubuntu-latest
runs-on: [self-hosted, regular]

steps:
- name: Check minimum labels
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ on:

jobs:
deploy-dev:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Deploy dev
steps:
- name: PRINT VARS
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ on:

jobs:
print-vars:
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
name: Print vars
steps:
- name: PRINT VARS
Expand All @@ -60,7 +60,7 @@ jobs:

job-CE:
name: Edition CE
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
if: github.event.inputs.ce == 'true'
steps:
- run: echo "CE"
Expand All @@ -80,7 +80,7 @@ jobs:

job-EE:
name: Edition EE
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
if: github.event.inputs.ee == 'true'
steps:
- run: echo "EE"
Expand All @@ -100,7 +100,7 @@ jobs:

job-FE:
name: Edition FE
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
if: github.event.inputs.fe == 'true'
steps:
- run: echo "FE"
Expand All @@ -120,7 +120,7 @@ jobs:

job-SE:
name: Edition SE
runs-on: ubuntu-latest
runs-on: [self-hosted, regular, selectel]
if: github.event.inputs.se == 'true'
steps:
- run: echo "SE"
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/dev_registry-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2024 Flant JSC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Cleanup dev registries

env:
MODULES_REGISTRY: ${{ vars.DEV_REGISTRY }}
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
MODULES_MODULE_NAME: ${{ vars.MODULE_NAME }}
MODULES_MODULE_SOURCE: ${{ vars.DEV_MODULE_SOURCE }}
MODULES_REGISTRY_LOGIN: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
MODULES_REGISTRY_PASSWORD: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
WERF_DRY_RUN: "false"

on:
workflow_dispatch:
schedule:
- cron: "12 0 * * 6"

defaults:
run:
shell: bash

jobs:
lint:
runs-on: [self-hosted, regular, selectel]
name: Run cleanup
steps:
- uses: actions/checkout@v4
- uses: deckhouse/modules-actions/setup@v1

- name: Cleanup
run: |
werf cleanup \
--repo ${MODULES_MODULE_SOURCE}/${MODULES_MODULE_NAME} \
--without-kube=true --config werf_cleanup.yaml
12 changes: 12 additions & 0 deletions werf_cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
project: sds-node-configurator
configVersion: 1
cleanup:
keepPolicies:
- references:
branch: /.*/
limit:
in: 168h # keep dev images build during last week which not main|pre-alpha
- references:
branch: /main|pre-alpha/
imagesPerReference:
last: 5 # keep 5 images for branches main|pre-alpha

0 comments on commit f9b3bd0

Please sign in to comment.