Skip to content

Commit bcf8ca8

Browse files
authored
ci: print info about the environment, image size (#5869)
- Add information about container image layers size when printing info about the environment. - Print info about the environment during the CI job.
1 parent ce59f5c commit bcf8ca8

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ jobs:
152152
docker load --input /tmp/${{ env.CONTAINER_IMAGE_OUTPUT_IMAGE_NAME }}.tar
153153
docker image ls -a
154154
155+
- name: Print environment info
156+
run: |
157+
make info
158+
155159
- name: Update action.yml
156160
run: |
157161
echo "yq version: $(yq --version)"

‎Makefile‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ ifeq ($(INTERACTIVE), 1)
1414
DOCKER_FLAGS += -t
1515
endif
1616

17-
.PHONY: info
18-
info: ## Gather information about the runtime environment
19-
echo "whoami: $$(whoami)"; \
20-
echo "pwd: $$(pwd)"; \
21-
echo "ls -ahl: $$(ls -ahl)"; \
22-
docker images; \
23-
docker ps
24-
2517
.PHONY: help
2618
help: ## Show help
2719
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@@ -79,13 +71,29 @@ endif
7971

8072
DEV_CONTAINER_URL := "super-linter/dev-container:latest"
8173

82-
8374
ifeq ($(GITHUB_HEAD_REF),)
8475
RELEASE_PLEASE_TARGET_BRANCH := "$(shell git branch --show-current)"
8576
else
8677
RELEASE_PLEASE_TARGET_BRANCH := "${GITHUB_HEAD_REF}"
8778
endif
8879

80+
.PHONY: info
81+
info: ## Gather information about the runtime environment
82+
echo "whoami: $$(whoami)"; \
83+
echo "pwd: $$(pwd)"; \
84+
echo "IMAGE:" $(IMAGE) \
85+
echo "SUPER_LINTER_TEST_CONTAINER_URL:" $(SUPER_LINTER_TEST_CONTAINER_URL) \
86+
echo "ls -ahl: $$(ls -ahl)"; \
87+
docker images; \
88+
docker ps; \
89+
echo "Container image layers size:"; \
90+
docker history \
91+
--human \
92+
--no-trunc \
93+
--format "{{.Size}} {{.CreatedSince}} {{.CreatedBy}}" \
94+
$(SUPER_LINTER_TEST_CONTAINER_URL) \
95+
| sort --human
96+
8997
.PHONY: check-github-token
9098
check-github-token:
9199
@if [ ! -f "${GITHUB_TOKEN_PATH}" ]; then echo "Cannot find the file to load the GitHub access token: $(GITHUB_TOKEN_PATH). Create a readable file there, and populate it with a GitHub personal access token."; exit 1; fi

0 commit comments

Comments
 (0)