-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add inline-comparison as acceptance test (#130)
* add inline-compare as acceptance test Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * add additional RPM metadata Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * add comments and doc strings to the compare-* make targets Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
- Loading branch information
Showing
17 changed files
with
275 additions
and
113 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
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/snapshot | ||
.server/ | ||
.vscode/ | ||
*.fingerprint | ||
*.tar | ||
*.jar | ||
*.war | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,39 +1,49 @@ | ||
IMAGE = "centos:8" | ||
IMAGE_CLEAN = $(shell echo $(IMAGE) | tr ":" "_") | ||
syft_DIR = syft-reports | ||
syft_REPORT = $(syft_DIR)/$(IMAGE_CLEAN).json | ||
ifndef SYFT_CMD | ||
SYFT_CMD = go run ../../main.go | ||
endif | ||
|
||
IMAGE_CLEAN = $(shell echo $(COMPARE_IMAGE) | tr ":" "_") | ||
SYFT_DIR = syft-reports | ||
SYFT_REPORT = $(SYFT_DIR)/$(IMAGE_CLEAN).json | ||
INLINE_DIR = inline-reports | ||
INLINE_REPORT = $(INLINE_DIR)/$(IMAGE_CLEAN)-content-os.json | ||
|
||
ifndef syft_DIR | ||
$(error syft_DIR is not set) | ||
ifndef SYFT_DIR | ||
$(error SYFT_DIR is not set) | ||
endif | ||
|
||
ifndef INLINE_DIR | ||
$(error INLINE_DIR is not set) | ||
endif | ||
|
||
.PHONY: all | ||
all: compare | ||
.DEFAULT_GOAL := | ||
all: clean-syft | ||
./compare-all.sh | ||
|
||
.PHONY: compare | ||
compare: $(INLINE_REPORT) $(syft_REPORT) | ||
docker build -t compare-syft:latest . | ||
docker run compare-syft:latest $(IMAGE) | ||
.PHONY: compare-image | ||
compare-image: $(SYFT_REPORT) $(INLINE_REPORT) | ||
./compare.py $(COMPARE_IMAGE) | ||
|
||
.PHONY: gather-iamge | ||
gather-image: $(SYFT_REPORT) $(INLINE_REPORT) | ||
|
||
$(INLINE_REPORT): | ||
echo "Creating $(INLINE_REPORT)..." | ||
mkdir -p $(INLINE_DIR) | ||
curl -s https://ci-tools.anchore.io/inline_scan-v0.7.0 | bash -s -- -p -r $(IMAGE) | ||
curl -s https://ci-tools.anchore.io/inline_scan-v0.7.0 | bash -s -- -p -r $(COMPARE_IMAGE) | ||
mv anchore-reports/* $(INLINE_DIR)/ | ||
rmdir anchore-reports | ||
|
||
$(syft_REPORT): | ||
echo "Creating $(syft_REPORT)..." | ||
mkdir -p $(syft_DIR) | ||
docker pull $(IMAGE) | ||
go run ../../main.go $(IMAGE) -o json > $(syft_REPORT) | ||
$(SYFT_REPORT): | ||
echo "Creating $(SYFT_REPORT)..." | ||
mkdir -p $(SYFT_DIR) | ||
$(SYFT_CMD) $(COMPARE_IMAGE) -o json > $(SYFT_REPORT) | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f $(INLINE_DIR)/* $(syft_DIR)/* | ||
clean: clean-syft | ||
rm -f $(INLINE_DIR)/* | ||
|
||
.PHONY: clean-syft | ||
clean-syft: | ||
rm -f $(SYFT_DIR)/* |
Oops, something went wrong.