Initial commit
This commit is contained in:
commit
92ce9d4f68
1
.docker-scan-plugin.metadata
Normal file
1
.docker-scan-plugin.metadata
Normal file
@ -0,0 +1 @@
|
||||
2ae9a8723f70a47f36bff2228914b136c073a262 SOURCES/scan-cli-plugin.tgz
|
54
SPECS/docker-scan-plugin.spec
Normal file
54
SPECS/docker-scan-plugin.spec
Normal file
@ -0,0 +1,54 @@
|
||||
%global debug_package %{nil}
|
||||
|
||||
Name: docker-scan-plugin
|
||||
Version: %{_scan_rpm_version}
|
||||
Release: %{_release}%{?dist}
|
||||
Epoch: 0
|
||||
Source0: scan-cli-plugin.tgz
|
||||
Summary: Docker Scan plugin for the Docker CLI
|
||||
Group: Tools/Docker
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/docker/scan-cli-plugin/
|
||||
Vendor: Docker
|
||||
Packager: Docker <support@docker.com>
|
||||
|
||||
Requires: docker-ce-cli
|
||||
|
||||
# TODO change once we support scan-plugin on other architectures
|
||||
BuildArch: x86_64
|
||||
BuildRequires: bash
|
||||
BuildRequires: golang
|
||||
|
||||
%description
|
||||
Docker Scan plugin for the Docker CLI.
|
||||
|
||||
%prep
|
||||
%setup -q -c -n src -a 0
|
||||
|
||||
%build
|
||||
pushd ${RPM_BUILD_DIR}/src/scan-cli-plugin
|
||||
bash -c 'TAG_NAME="%{_scan_version}" COMMIT="%{_scan_gitcommit}" PLATFORM_BINARY=docker-scan make native-build'
|
||||
popd
|
||||
|
||||
|
||||
%check
|
||||
# FIXME: --version currently doesn't work as it makes a connection to the daemon, so using the plugin metadata instead
|
||||
#${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-scan scan --accept-license --version
|
||||
ver="$(${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-scan docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $1 == "Version" { print $2 }')"; \
|
||||
test "$ver" = "%{_scan_version}" && echo "PASS: docker-scan version OK" || (echo "FAIL: docker-scan version ($ver) did not match" && exit 1)
|
||||
|
||||
%install
|
||||
pushd ${RPM_BUILD_DIR}/src/scan-cli-plugin
|
||||
install -D -p -m 0755 bin/docker-scan ${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-scan
|
||||
popd
|
||||
|
||||
%files
|
||||
%{_libexecdir}/docker/cli-plugins/docker-scan
|
||||
|
||||
%post
|
||||
|
||||
%preun
|
||||
|
||||
%postun
|
||||
|
||||
%changelog
|
Loading…
Reference in New Issue
Block a user