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 Split Functionality #3092

Merged
merged 2 commits into from
Oct 3, 2023
Merged
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
20 changes: 18 additions & 2 deletions .github/workflows/regsync-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PUSH_TOKEN }}
- uses: ruby/setup-ruby@v1
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.
Expand All @@ -40,6 +43,19 @@ jobs:
git add regsync.yaml
git commit -m "Updating resync.yaml"
git branch
sleep 30
git push


- 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: |
head regsync.yaml
ruby ./regsync-split.rb
time find regsync -type f -name regsync.yaml -print -exec time regsync check --config '{}' ';'
env:
REGISTRY_ENDPOINT: ${{ secrets.REGISTRY_ENDPOINT }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
10 changes: 5 additions & 5 deletions regsync-split.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#! /usr/bin/env ruby

require "json"
require "pathname"
require "yaml"

pwd = Pathname(Dir.pwd)

regsync = YAML.load((pwd + "regsync.yaml").read)

regsync["sync"].sum do |sync|
sync["tags"]["allow"].count
end.then do |sum|
puts "total tags to consider: #{sum}"
end

regsync["sync"].each do |sync|
regsync.merge("sync" => [sync]).then do |regsync|
(pwd + "regsync" + sync["source"]).then do |dir|
Expand Down
Loading