From 9aa12defca0c17df5a8dcbed9b05a3105b45c1a5 Mon Sep 17 00:00:00 2001 From: chenliufeiyang Date: Fri, 20 May 2022 10:04:38 +0800 Subject: [PATCH] feature: Add skyline-console commit-id 1. add wget and tar into makefile to get skyline-console package 2. set skyline-console commit into skyline docker image as label Depends-On: https://review.opendev.org/c/openstack/skyline-console/+/841664 Change-Id: Id69ba06c91343ca6bdccab85c45d258a3a6eaa19 --- .gitignore | 1 + Makefile | 4 +++- container/Dockerfile | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c576313..05151e0 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,7 @@ venv.bak/ /log/ tmp/ test_results.html +skyline-console-* # MAC OS .DS_Store diff --git a/Makefile b/Makefile index df3dd13..a609404 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,9 @@ else $(error Unsupported build engine $(BUILD_ENGINE)) endif build: - $(build_cmd) --no-cache --pull --force-rm --build-arg RELEASE_VERSION=$(RELEASE_VERSION) --build-arg SKYLINE_CONSOLE_PACKAGE_URL=$(SKYLINE_CONSOLE_PACKAGE_URL) --build-arg GIT_BRANCH=$(GIT_BRANCH) --build-arg GIT_COMMIT=$(GIT_COMMIT) $(BUILD_ARGS) -f $(DOCKER_FILE) -t $(IMAGE):$(IMAGE_TAG) $(BUILD_CONTEXT) + GIT_CONSOLE_COMMIT=$(shell wget $(SKYLINE_CONSOLE_PACKAGE_URL) && tar -zxf skyline-console-master.tar.gz && cat skyline-console-0.1.0/skyline_console/static/commit_id.txt); \ + $(build_cmd) --no-cache --pull --force-rm --build-arg RELEASE_VERSION=$(RELEASE_VERSION) --build-arg SKYLINE_CONSOLE_PACKAGE_URL=$(SKYLINE_CONSOLE_PACKAGE_URL) --build-arg GIT_BRANCH=$(GIT_BRANCH) --build-arg GIT_COMMIT=$(GIT_COMMIT) --build-arg GIT_CONSOLE_COMMIT=$$GIT_CONSOLE_COMMIT $(BUILD_ARGS) -f $(DOCKER_FILE) -t $(IMAGE):$(IMAGE_TAG) $(BUILD_CONTEXT) + rm -rf skyline-console-* .PHONY: swagger diff --git a/container/Dockerfile b/container/Dockerfile index 6658ce1..cfe6dd3 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -2,11 +2,13 @@ FROM ubuntu:20.04 ARG GIT_BRANCH ARG GIT_COMMIT +ARG GIT_CONSOLE_COMMIT ARG RELEASE_VERSION ARG SKYLINE_CONSOLE_PACKAGE_URL LABEL skyline.build_branch=${GIT_BRANCH}\ skyline.build_commit=${GIT_COMMIT} \ + skyline.build_console_commit=${GIT_CONSOLE_COMMIT} \ skyline.release_version=${RELEASE_VERSION} ENV LANG C.UTF-8