diff --git a/PBuild/Job.pm b/PBuild/Job.pm index aa3516c95..9b1c5b74d 100644 --- a/PBuild/Job.pm +++ b/PBuild/Job.pm @@ -127,7 +127,7 @@ sub collect_result { } @d = ('ARCHPKGS') if $p->{'recipe'} =~ /PKGBUILD$/; @d = ('KIWI') if $p->{'recipe'} =~ /\.kiwi$/; - @d = ('DOCKER') if $p->{'recipe'} =~ /Dockerfile$/; + @d = ('DOCKER') if $p->{'recipe'} =~ /Dockerfile(\.|$)/; @d = ('FISSILE') if $p->{'recipe'} =~ /fissile\.yml$/; @d = ('HELM') if $p->{'recipe'} =~ /Chart\.yaml$/; push @d, 'OTHER'; diff --git a/PBuild/Recipe.pm b/PBuild/Recipe.pm index b18aafa81..ca8576f3c 100644 --- a/PBuild/Recipe.pm +++ b/PBuild/Recipe.pm @@ -45,6 +45,7 @@ sub find_recipe { return $files{'PKGBUILD'} ? $files{'PKGBUILD'} : undef if $type eq 'arch'; my $pkg = $p->{'pkg'}; $pkg = $p->{'flavor'} if $p->{'flavor'}; + return $files{"Dockerfile.$pkg"} if $type eq 'docker' && $files{"Dockerfile.$pkg"}; return $files{"$pkg.$type"} if $files{"$pkg.$type"}; # try again without last components return $files{"$1.$type"} if $pkg =~ /^(.*?)\./ && $files{"$1.$type"}; @@ -60,6 +61,7 @@ sub find_recipe { # as last resort ignore the type for image/container building if ($type ne 'docker') { return $files{'Dockerfile'} if $files{'Dockerfile'}; + return $files{"Dockerfile.$pkg"} if $files{"Dockerfile.$pkg"}; } if ($type ne 'kiwi') { @files = grep {/\.kiwi$/} keys %files; @@ -202,7 +204,7 @@ sub looks_like_packagedir { return 0 if grep {/^_build\./} @files; for my $file (@files) { return 1 if $file =~ /\.(?:spec|dsc|kiwi)$/; - return 1 if $file =~ /^mkosi\./; + return 1 if $file =~ /^(?:Dockerfile|mkosi)\./; return 1 if $file eq 'snapcraft.yaml' || $file eq 'appimage.yml'; return 1 if $file eq 'Dockerfile' || $file eq 'fissile.yml' || $file eq 'Chart.yml'; return 1 if $file eq 'PKGBUILD'; diff --git a/build-recipe b/build-recipe index 10c06c624..a5088fa17 100644 --- a/build-recipe +++ b/build-recipe @@ -125,7 +125,7 @@ recipe_set_buildtype() { PKGBUILD) BUILDTYPE=arch ;; snapcraft.yaml) BUILDTYPE=snapcraft ;; appimage.yml) BUILDTYPE=appimage ;; - Dockerfile) BUILDTYPE=docker ;; + Dockerfile|Dockerfile.*) BUILDTYPE=docker ;; fissile.yml) BUILDTYPE=fissile ;; build.collax) BUILDTYPE=collax ;; _preinstallimage) BUILDTYPE=preinstallimage ;; @@ -140,7 +140,7 @@ recipe_set_buildtype() { mkosi.*) BUILDTYPE=mkosi ;; esac if test -z "$BUILDTYPE" ; then - cleanup_and_exit 1 "I don't know how to build $RECIPEFILE" + cleanup_and_exit 1 "I don't know how to build $RECIPEFILE" fi # we can't query right after vm startup, so we put the BUILDENGINE in the build.data if test -z "$RUNNING_IN_VM" ; then diff --git a/download_assets b/download_assets index 4cd7b283b..b7878c9fb 100755 --- a/download_assets +++ b/download_assets @@ -153,8 +153,8 @@ for my $dir (@dirs) { find_assets($assetmgr, $bconf, $p, $opts->{'recipe'}); } else { for my $file (sort keys %$files) { - next unless $file eq 'sources' || $file eq 'go.sum' || $file eq 'PKGBUILD' || $file eq 'Dockerfile' || $file =~ /\.(?:spec|dsc|kiwi)/; - find_assets($assetmgr, $bconf, $p, $file); + next unless $file eq 'sources' || $file eq 'go.sum' || $file eq 'PKGBUILD' || $file eq 'Dockerfile' || $file =~ /^Dockerfile\./ || $file =~ /\.(?:spec|dsc|kiwi)/; + find_assets($assetmgr, $bconf, $p, $file); } } }