Skip to content

Commit 7713c56

Browse files
authored
[CI] Fixed runners and added dev registry cleanup (#28)
Signed-off-by: v.oleynikov <[email protected]>
1 parent e0cf18f commit 7713c56

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright 2024 Flant JSC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Cleanup dev registries
16+
17+
env:
18+
MODULES_REGISTRY: ${{ vars.DEV_REGISTRY }}
19+
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
20+
MODULES_MODULE_NAME: ${{ vars.MODULE_NAME }}
21+
MODULES_MODULE_SOURCE: ${{ vars.DEV_MODULE_SOURCE }}
22+
MODULES_REGISTRY_LOGIN: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }}
23+
MODULES_REGISTRY_PASSWORD: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
24+
WERF_DRY_RUN: "false"
25+
26+
on:
27+
workflow_dispatch:
28+
schedule:
29+
- cron: "12 0 * * 6"
30+
31+
defaults:
32+
run:
33+
shell: bash
34+
35+
jobs:
36+
lint:
37+
runs-on: [self-hosted, regular, selectel]
38+
name: Run cleanup
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: deckhouse/modules-actions/setup@v1
42+
43+
- name: Cleanup
44+
run: |
45+
werf cleanup \
46+
--repo ${MODULES_MODULE_SOURCE}/${MODULES_MODULE_NAME} \
47+
--without-kube=true --config werf_cleanup.yaml

werf_cleanup.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
project: csi-nfs
2+
configVersion: 1
3+
cleanup:
4+
keepPolicies:
5+
- references:
6+
branch: /.*/
7+
limit:
8+
in: 168h # keep dev images build during last week which not main|pre-alpha
9+
- references:
10+
branch: /main|pre-alpha/
11+
imagesPerReference:
12+
last: 5 # keep 5 images for branches main|pre-alpha

0 commit comments

Comments
 (0)