apko: 0.4.0 -> 0.8.0 (#228007)

Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
This commit is contained in:
Batuhan Apaydın 2023-05-26 13:13:21 +03:00 committed by GitHub
parent f902e5b602
commit bbf921352f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,13 +6,13 @@
buildGoModule rec {
pname = "apko";
version = "0.4.0";
version = "0.8.0";
src = fetchFromGitHub {
owner = "chainguard-dev";
repo = pname;
rev = "v${version}";
sha256 = "sha256-gmBcN1lxzkkRpiUUWv87ji/G4Uy3DA8a6+6Qs+p/2mg=";
sha256 = "sha256-02W9YOnV/zXopH3C9UNKu5gepNVS2gzoGa10uaKYu94=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
@ -24,7 +24,7 @@ buildGoModule rec {
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
vendorSha256 = "sha256-3gRECgKvGqkgBzB3SSxm6/LxZG8RxhjoC6Q7DZj/Has=";
vendorSha256 = "sha256-h1uAAL3FBskx6Qv9E5WY+UPeXK49WW/hFoNN4QyKevU=";
nativeBuildInputs = [ installShellFiles ];
@ -42,11 +42,14 @@ buildGoModule rec {
'';
preCheck = ''
# requires network access to fetch alpine linux keyring
substituteInPlace pkg/apk/apk_unit_test.go \
--replace "TestInitKeyring" "SkipInitKeyring"
# disable tests that require network access
rm pkg/apk/impl/implementation_test.go
'';
doCheck = true;
doInstallCheck = true;
postInstall = ''
installShellCompletion --cmd apko \
--bash <($out/bin/apko completion bash) \
@ -54,11 +57,12 @@ buildGoModule rec {
--zsh <($out/bin/apko completion zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/apko --help
$out/bin/apko version 2>&1 | grep "v${version}"
runHook postInstallCheck
'';
@ -67,6 +71,6 @@ buildGoModule rec {
changelog = "https://github.com/chainguard-dev/apko/blob/main/NEWS.md";
description = "Build OCI images using APK directly without Dockerfile";
license = licenses.asl20;
maintainers = with maintainers; [ jk ];
maintainers = with maintainers; [ jk developer-guy ];
};
}