Use a custom image for building and more scripts

This commit is contained in:
Nikolai Rodionov
2023-04-24 18:01:13 +02:00
parent 27b1b4acc0
commit b5e304bc3c
10 changed files with 213 additions and 48 deletions

View File

@ -5,13 +5,23 @@ my $main_branch = "main";
my $common_bucket = "badhouseplants-minio:/badhouseplants-net";
my $main_bucket = "badhouseplants-minio:/badhouseplants-net-main";
chop($git_branch);
chop($git_commit_sha);
# --------------------------------------------------
# -- I'm doing all of it because I can't undestand
# -- how not to send 300Mb to the buildah context
# --------------------------------------------------
chomp($git_branch);
chomp($git_commit_sha);
print `cp -r . /tmp/$git_commit_sha` or die;
print "Getting the lfs data\n";
print `git -C /tmp/$git_commit_sha lfs pull` or die;
print "Creating a new hashed dir in the common bucket\n";
print `rclone copy -P static "$common_bucket/$git_commit_sha"`;
print `rclone copy -P /tmp/$git_commit_sha/static "$common_bucket/$git_commit_sha"` or die;
if ( $git_branch eq $main_branch) {
print "Syncing to the production bucket\n";
print `rclone sync -P "$common_bucket/$git_commit_sha" "$main_bucket/"`;
print `rclone sync -P "$common_bucket/$git_commit_sha" "$main_bucket/"` or die;
}