Skip to content

Commit

Permalink
Merge pull request #3092 from rancher/eio-regsync-testing
Browse files Browse the repository at this point in the history
Testing Split Functionality
  • Loading branch information
rohitsakala authored Oct 3, 2023
2 parents b48b8ba + 9745ae7 commit a4031e4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
19 changes: 18 additions & 1 deletion .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 @@ -41,4 +44,18 @@ jobs:
git commit -m "Updating resync.yaml"
git branch
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

0 comments on commit a4031e4

Please sign in to comment.