-
Notifications
You must be signed in to change notification settings - Fork 911
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4758 from galaxyproject/tamandua-ostrich
No more full depth clones for deployment
- Loading branch information
Showing
15 changed files
with
124,721 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: "[Cron] Update Commit Cache" | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '45 0 * * 1' | ||
jobs: | ||
runner-job: | ||
runs-on: ubuntu-latest | ||
# Only run on main repo on and PRs that match the main repo. | ||
if: | | ||
github.repository == 'galaxyproject/training-material' && | ||
(github.event_name != 'pull_request' || | ||
github.event.pull_request.head.repo.full_name == github.repository) | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1000 | ||
|
||
# BEGIN Dependencies | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.0" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Install dependencies | ||
run: | | ||
gem install bundler | ||
bundle config path vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
bundle pristine ffi | ||
# END Dependencies | ||
|
||
- name: Update commit cache | ||
id: generate | ||
run: | | ||
# Check if the oldest commit of the commit cache is known in this history | ||
last_cached_commit=$(ls metadata/git-mod-*.txt | cut -d- -f 3 | cut -d. -f 1) | ||
git show $last_cached_commit | ||
ec=$? | ||
if (( ec != 0 )); then | ||
# Worst case, we need to fetch more. just fetch everything to be safe. | ||
git fetch --unshallow | ||
fi | ||
ruby bin/commit-cache-update.rb >> $GITHUB_OUTPUT | ||
- name: Create Pull Request | ||
# If it's not a Pull Request then commit any changes as a new PR. | ||
if: | | ||
github.event_name != 'pull_request' && | ||
steps.generate.outputs.new_ids != '' | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
title: Update Cached Commit Data | ||
branch-suffix: commitcache | ||
commit-message: Update Cached Commit Data | ||
add-paths: metadata/git-*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require './_plugins/gtn' | ||
|
||
# Write the commit log | ||
Gtn::ModificationTimes.generate_cache | ||
Gtn::PublicationTimes.generate_cache | ||
|
||
# Gziped? | ||
# require 'zlib' | ||
# File.write("metadata/git-mod-#{rev}.txt.gz", Zlib.gzip(Gtn::ModificationTimes.command)) | ||
# File.write("metadata/git-pub-#{rev}.txt.gz", Zlib.gzip(Gtn::PublicationTimes.command)) | ||
# p Gtn::ModificationTimes.discover_caches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env ruby | ||
require './_plugins/gtn' | ||
|
||
months = (ARGV[1] || 6).to_i | ||
|
||
Gtn::ModificationTimes.init_cache | ||
Gtn::ModificationTimes.time_cache.select do |_, v| | ||
# Things in last 6 months | ||
v > Time.now - (months * 30 * 24 * 60 * 60) | ||
end.map { |k, v| puts "#{v} #{k}" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env ruby | ||
require './_plugins/gtn' | ||
|
||
months = (ARGV[1] || 6).to_i | ||
|
||
Gtn::PublicationTimes.init_cache | ||
Gtn::PublicationTimes.time_cache.select do |_, v| | ||
# Things in last 6 months | ||
v > Time.now - (months * 30 * 24 * 60 * 60) | ||
end.map { |k, v| puts "#{v} #{k}" } |
Oops, something went wrong.