Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing fixes to regsync action #3158

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions .github/workflows/regsync-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: Generate-Regsync-Config

on:
pull_request_target:
pull_request:
types:
- labeled

Expand Down Expand Up @@ -43,36 +43,44 @@ jobs:
with:
ruby-version: '3.2' # Not needed with a .ruby-version file

# Need to remove export version once rancher/charts gets the latest version
# of charts-build-script binary.
# Test removal of regsync.yaml, commit and push before regenerating it
- name: Generate RegSync
run: |
echo ${{ secrets.PUSH_TOKEN }} | gh auth login --with-token
gh pr checkout ${{ github.event.pull_request.number }}
git config --global user.email "${{ secrets.USER_GITHUB }}"
git config --global user.name "rancherbot"
export CHARTS_BUILD_SCRIPT_VERSION=v0.4.2
make pull-scripts
make regsync

- name: Check for modifications in regsync.yaml
id: check_changes
run: |
git diff --quiet regsync.yaml || echo "::set-output name=changed::true"

- name: Commit files
if: steps.check_changes.outputs.changed == 'true'
run: |
git add regsync.yaml
git commit -m "Updating resync.yaml"
git commit -m "Updating regsync.yaml"
git branch
git push

- name: No changes in regsync.yaml
if: steps.check_changes.outputs.changed != 'true'
run: |
echo "regsync.yaml is the same"

- name: Install Regsync
run: |
curl --silent --fail --location --output regsync https://github.com/regclient/regclient/releases/download/v0.5.1/regsync-linux-amd64
chmod +x regsync

- name: Sync Images to Registry
run: |
export PATH=$PATH:$(pwd)
head regsync.yaml
ruby ./regsync-split.rb
time find regsync -type f -name split-regsync.yaml -print -exec time regsync once --config '{}' ';'
tree ./split-regsync
env:
REGISTRY_ENDPOINT: ${{ secrets.REGISTRY_ENDPOINT }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
Expand Down
10 changes: 2 additions & 8 deletions regsync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ creds:
- registry: '{{ env "REGISTRY_ENDPOINT" }}'
user: '{{ env "REGISTRY_USERNAME" }}'
pass: '{{ env "REGISTRY_PASSWORD" }}'
reqConcurrent: 10
reqPerSec: 50
defaults:
mediaTypes:
- application/vnd.docker.distribution.manifest.v2+json
Expand Down Expand Up @@ -535,7 +537,6 @@ sync:
type: repository
tags:
allow:
- latest
- v1.18.0
- v1.19.0
- v1.2.1
Expand All @@ -560,7 +561,6 @@ sync:
type: repository
tags:
allow:
- latest
- v2.1.0
- v2.2.1
- v2.3.0
Expand All @@ -578,7 +578,6 @@ sync:
type: repository
tags:
allow:
- latest
- v2.1.0
- v2.2.1
- v2.3.0
Expand Down Expand Up @@ -1344,7 +1343,6 @@ sync:
type: repository
tags:
allow:
- latest
- v3.2.0
- v3.3.0
- v3.4.0
Expand All @@ -1355,7 +1353,6 @@ sync:
type: repository
tags:
allow:
- latest
- v2.3.0
- v2.5.0
- v2.5.1
Expand All @@ -1366,7 +1363,6 @@ sync:
type: repository
tags:
allow:
- latest
- v2.2.0
- v3.0.0
- v3.1.0
Expand All @@ -1378,7 +1374,6 @@ sync:
type: repository
tags:
allow:
- latest
- v1.3.0
- v1.4.0
- v1.6.0
Expand All @@ -1388,7 +1383,6 @@ sync:
type: repository
tags:
allow:
- latest
- v2.4.0
- v2.6.0
- v2.7.0
Expand Down
Loading