chore: naming convention of archive artifacts
It's better for sorting to add the git rev id as a suffix instead of a prefix
This commit is contained in:
parent
d91d6ac123
commit
5fe08bda03
1 changed files with 12 additions and 12 deletions
24
Makefile
24
Makefile
|
|
@ -92,22 +92,22 @@ ifdef SCAN
|
||||||
mkdir -p "test-reports/$(TAG_NAME_PREFIX)"
|
mkdir -p "test-reports/$(TAG_NAME_PREFIX)"
|
||||||
trivy image \
|
trivy image \
|
||||||
--format json \
|
--format json \
|
||||||
--output test-reports/$(TAG_NAME_PREFIX)$$(git rev-parse --short HEAD)-$@.trivy.json \
|
--output test-reports/$(TAG_NAME_PREFIX)$@-$$(git rev-parse --short HEAD).trivy.json \
|
||||||
$(TAG_NAME_PREFIX)$@
|
$(TAG_NAME_PREFIX)$@
|
||||||
ifdef SIGN_SCAN
|
ifdef SIGN_SCAN
|
||||||
gpg --detach-sign --local-user $(GPG_SIGNER_FINGERPRINT) -v -a --yes test-reports/$(TAG_NAME_PREFIX)$$(git rev-parse --short HEAD)-$@.trivy.json
|
gpg --detach-sign --local-user $(GPG_SIGNER_FINGERPRINT) -v -a --yes test-reports/$(TAG_NAME_PREFIX)$@-$$(git rev-parse --short HEAD).trivy.json
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef ARCHIVE
|
ifdef ARCHIVE
|
||||||
export archive_path="$(ARCHIVE_PATH_PREFIX)$$(git rev-parse --short HEAD)-$@.tar"; \
|
export archive_path="$(ARCHIVE_PATH_PREFIX)$@-$$(git rev-parse --short HEAD).tar"; \
|
||||||
export manifest_path="$(ARCHIVE_PATH_PREFIX)$$(git rev-parse --short HEAD)-$@.manifest.json"; \
|
export manifest_path="$(ARCHIVE_PATH_PREFIX)$@-$$(git rev-parse --short HEAD).manifest.json"; \
|
||||||
mkdir -p "$$(dirname $$archive_path)" && \
|
mkdir -p "$$(dirname $$archive_path)" && \
|
||||||
docker save -o "$$archive_path" "$(DOCKER_REGISTRY)/$(DOCKER_REPO_SLUG)/$@" && \
|
docker save -o "$$archive_path" "$(DOCKER_REGISTRY)/$(DOCKER_REPO_SLUG)/$@" && \
|
||||||
tar -xf "$$archive_path" manifest.json --to-stdout > $$manifest_path; \
|
tar -xf "$$archive_path" manifest.json --to-stdout > $$manifest_path; \
|
||||||
gzip -vf "$$archive_path"
|
gzip -vf "$$archive_path"
|
||||||
ifdef SIGN_ARCHIVE
|
ifdef SIGN_ARCHIVE
|
||||||
export archive_path="$(ARCHIVE_PATH_PREFIX)$$(git rev-parse --short HEAD)-$@.tar.gz"; \
|
export archive_path="$(ARCHIVE_PATH_PREFIX)$@-$$(git rev-parse --short HEAD).tar.gz"; \
|
||||||
export manifest_path="$(ARCHIVE_PATH_PREFIX)$$(git rev-parse --short HEAD)-$@.manifest.json"; \
|
export manifest_path="$(ARCHIVE_PATH_PREFIX)$@-$$(git rev-parse --short HEAD).manifest.json"; \
|
||||||
gpg --detach-sign --local-user $(GPG_SIGNER_FINGERPRINT) -v -a --yes "$$manifest_path"; \
|
gpg --detach-sign --local-user $(GPG_SIGNER_FINGERPRINT) -v -a --yes "$$manifest_path"; \
|
||||||
gpg --detach-sign --local-user $(GPG_SIGNER_FINGERPRINT) -v -a --yes "$$archive_path";
|
gpg --detach-sign --local-user $(GPG_SIGNER_FINGERPRINT) -v -a --yes "$$archive_path";
|
||||||
endif
|
endif
|
||||||
|
|
@ -115,16 +115,16 @@ ifdef PUBLISH_ARCHIVE
|
||||||
ifndef BITBUCKET_ACCESS_TOKEN
|
ifndef BITBUCKET_ACCESS_TOKEN
|
||||||
$(error BITBUCKET_ACCESS_TOKEN not set)
|
$(error BITBUCKET_ACCESS_TOKEN not set)
|
||||||
endif
|
endif
|
||||||
$(call bitbucket-upload,$(ARCHIVE_PATH_PREFIX)$$(git rev-parse --short HEAD)-$@.tar.gz)
|
$(call bitbucket-upload,$(ARCHIVE_PATH_PREFIX)$@-$$(git rev-parse --short HEAD).tar.gz)
|
||||||
$(call bitbucket-upload,$(ARCHIVE_PATH_PREFIX)$$(git rev-parse --short HEAD)-$@.manifest.json)
|
$(call bitbucket-upload,$(ARCHIVE_PATH_PREFIX)$@-$$(git rev-parse --short HEAD).manifest.json)
|
||||||
ifdef SIGN_ARCHIVE
|
ifdef SIGN_ARCHIVE
|
||||||
$(call bitbucket-upload,$(ARCHIVE_PATH_PREFIX)$$(git rev-parse --short HEAD)-$@.tar.gz.asc)
|
$(call bitbucket-upload,$(ARCHIVE_PATH_PREFIX)$@-$$(git rev-parse --short HEAD).tar.gz.asc)
|
||||||
$(call bitbucket-upload,$(ARCHIVE_PATH_PREFIX)$$(git rev-parse --short HEAD)-$@.manifest.json.asc)
|
$(call bitbucket-upload,$(ARCHIVE_PATH_PREFIX)$@-$$(git rev-parse --short HEAD).manifest.json.asc)
|
||||||
endif
|
endif
|
||||||
ifdef SCAN
|
ifdef SCAN
|
||||||
$(call bitbucket-upload,test-reports/$(TAG_NAME_PREFIX)$$(git rev-parse --short HEAD)-$@.trivy.json)
|
$(call bitbucket-upload,test-reports/$(TAG_NAME_PREFIX)$@-$$(git rev-parse --short HEAD).trivy.json)
|
||||||
ifdef SIGN_SCAN
|
ifdef SIGN_SCAN
|
||||||
$(call bitbucket-upload,test-reports/$(TAG_NAME_PREFIX)$$(git rev-parse --short HEAD)-$@.trivy.json.asc)
|
$(call bitbucket-upload,test-reports/$(TAG_NAME_PREFIX)$@-$$(git rev-parse --short HEAD).trivy.json.asc)
|
||||||
endif # SIGN_SCAN
|
endif # SIGN_SCAN
|
||||||
endif # SCAN
|
endif # SCAN
|
||||||
endif # PUBLISH_ARCHIVE
|
endif # PUBLISH_ARCHIVE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue