containerd: use git-commit to store commit ID
Signed-off-by: liuzekun <liuzekun@huawei.com>
This commit is contained in:
parent
93cdc66ff6
commit
bada571c96
@ -12,6 +12,9 @@ cwd=$PWD
|
|||||||
src=$cwd/$pkg
|
src=$cwd/$pkg
|
||||||
|
|
||||||
unzip $pkg.zip
|
unzip $pkg.zip
|
||||||
|
if [[ ! -d patch ]]; then
|
||||||
|
tar zxf patch.tar.gz
|
||||||
|
fi
|
||||||
|
|
||||||
cd $src
|
cd $src
|
||||||
git init
|
git init
|
||||||
|
|||||||
@ -2,11 +2,16 @@
|
|||||||
%global debug_package %{nil}
|
%global debug_package %{nil}
|
||||||
Version: 1.2.0
|
Version: 1.2.0
|
||||||
Name: containerd
|
Name: containerd
|
||||||
Release: 101
|
Release: 102
|
||||||
Summary: An industry-standard container runtime
|
Summary: An industry-standard container runtime
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
URL: https://containerd.io
|
URL: https://containerd.io
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: containerd-1.2.0.zip
|
||||||
|
Source1: patch.tar.gz
|
||||||
|
Source2: apply-patch
|
||||||
|
Source3: series.conf
|
||||||
|
Source4: git-commit
|
||||||
|
Source5: gen-commit.sh
|
||||||
|
|
||||||
BuildRequires: golang glibc-static make btrfs-progs-devel
|
BuildRequires: golang glibc-static make btrfs-progs-devel
|
||||||
|
|
||||||
@ -18,10 +23,14 @@ system: image transfer and storage, container execution and supervision,
|
|||||||
low-level storage and network attachments, etc.
|
low-level storage and network attachments, etc.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -c -n containerd
|
cp %{SOURCE0} .
|
||||||
|
cp %{SOURCE1} .
|
||||||
|
cp %{SOURCE2} .
|
||||||
|
cp %{SOURCE3} .
|
||||||
|
cp %{SOURCE4} .
|
||||||
|
|
||||||
%build
|
%build
|
||||||
./apply-patch
|
bash ./apply-patch
|
||||||
|
|
||||||
GO_BUILD_PATH=$PWD/_build
|
GO_BUILD_PATH=$PWD/_build
|
||||||
install -m 0755 -vd $(dirname $GO_BUILD_PATH/src/%{goipath})
|
install -m 0755 -vd $(dirname $GO_BUILD_PATH/src/%{goipath})
|
||||||
|
|||||||
12
gen-commit.sh
Normal file
12
gen-commit.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
|
||||||
|
# Description: This shell script is used to generate commitID store file.
|
||||||
|
# Author: liuzekun@huawei.com
|
||||||
|
# Create: 2020-06-10
|
||||||
|
|
||||||
|
change_id=$(git log -1 | grep Change-Id | awk '{print $2}')
|
||||||
|
if [[ "${change_id}" = "" ]]; then
|
||||||
|
change_id=$(date | sha256sum | head -c 40)
|
||||||
|
fi
|
||||||
|
echo "${change_id}" > git-commit
|
||||||
1
git-commit
Normal file
1
git-commit
Normal file
@ -0,0 +1 @@
|
|||||||
|
3f69708bd238c592ce917876ee841524a51cb781
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
From fe8ce77e756f7f468ed65c8c42a9f91becabbf4e Mon Sep 17 00:00:00 2001
|
||||||
|
From: liuzekun <liuzekun@huawei.com>
|
||||||
|
Date: Wed, 10 Jun 2020 00:37:01 -0400
|
||||||
|
Subject: [PATCH] containerd: use git-commit to store commit ID
|
||||||
|
|
||||||
|
Signed-off-by: liuzekun <liuzekun@huawei.com>
|
||||||
|
---
|
||||||
|
Makefile | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 9e7f3ae..6011aa1 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -21,7 +21,7 @@ DESTDIR=/usr/local
|
||||||
|
|
||||||
|
# Used to populate variables in version package.
|
||||||
|
VERSION=$(shell echo version:)$(shell grep '^Version' ${ROOTDIR}/containerd.spec | sed 's/[^0-9.]*\([0-9.]*\).*/\1/').$(shell grep '^Release:' ${ROOTDIR}/containerd.spec | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
|
||||||
|
-REVISION=$(shell echo commit:)$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)
|
||||||
|
+REVISION=$(shell cat ./git-commit | head -c 40)
|
||||||
|
|
||||||
|
ifneq "$(strip $(shell command -v go 2>/dev/null))" ""
|
||||||
|
GOOS ?= $(shell go env GOOS)
|
||||||
|
--
|
||||||
|
2.19.1
|
||||||
|
|
||||||
@ -60,3 +60,4 @@ patch/0054-containerd-clean-up-residual-container.patch
|
|||||||
patch/0055-containerd-add-LLT-for-containerd-shim-timeou.patch
|
patch/0055-containerd-add-LLT-for-containerd-shim-timeou.patch
|
||||||
patch/0056-containerd-save-dumpstack-to-file.patch
|
patch/0056-containerd-save-dumpstack-to-file.patch
|
||||||
patch/0057-containerd-add-timeout-for-delete-command.patch
|
patch/0057-containerd-add-timeout-for-delete-command.patch
|
||||||
|
patch/0058-containerd-use-git-commit-to-store-commit-ID.patch
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user