registry-token-server: refactor debian folder to remove dl_hook
Use the "src_path" to point local src Use the "dl_files" to download tar balls Use the "src_files" to point extra local files Add a new patch 0001-main.go-workaround-go-install-issue.patch to replace the workaround of go install issue in dl_hook Remove the dl_hook Signed-off-by: Yue Tao <Yue.Tao@windriver.com> Change-Id: I1d458a7ce5019c19c25fb9bf4be628844dae7088
This commit is contained in:
parent
fedb99c424
commit
c0a8eb4072
@ -1,55 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
pull_source() {
|
||||
if [ "$1" = "" ] ; then
|
||||
exit 1
|
||||
fi
|
||||
cp -r $1 ${PKG_BUILD_ROOT}/
|
||||
}
|
||||
|
||||
############################################
|
||||
### WORKAROUND until build tools support ###
|
||||
############################################
|
||||
STX_MIRROR=$(realpath "/import/mirrors/starlingx")
|
||||
######################
|
||||
### END WORKAROUND ###
|
||||
######################
|
||||
STX_BASE=$(realpath ${MY_REPO}/stx)
|
||||
STX_SOURCES=$(realpath ${STX_BASE}/containers/registry-token-server)
|
||||
|
||||
SRC=$(realpath ${STX_BASE}/containers/registry-token-server/src)
|
||||
EXTRA_FILE_SRC1=$(realpath ${STX_SOURCES}/centos/files/token_server.conf)
|
||||
SUBMODULE_SRC1=$(realpath ${STX_MIRROR}/downloads/Sirupsen-logrus-3d4380f53a34dcdc95f0c1db702615992b38d9a4.tar.gz)
|
||||
SUBMODULE_SRC2=$(realpath ${STX_MIRROR}/downloads/docker-distribution-v2.7.1.tar.gz)
|
||||
SUBMODULE_SRC3=$(realpath ${STX_MIRROR}/downloads/docker-libtrust-fa567046d9b14f6aa788882a950d69651d230b21.tar.gz)
|
||||
SUBMODULE_SRC4=$(realpath ${STX_MIRROR}/downloads/gophercloud-gophercloud-aa00757ee3ab58e53520b6cb910ca0543116400a.tar.gz)
|
||||
SUBMODULE_SRC5=$(realpath ${STX_MIRROR}/downloads/gorilla-mux-599cba5e7b6137d46ddf58fb1765f5d928e69604.tar.gz)
|
||||
|
||||
|
||||
PKG_BUILD_NAME=$1
|
||||
PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME})
|
||||
mkdir ${PKG_BUILD_NAME}
|
||||
pushd ${PKG_BUILD_NAME}
|
||||
|
||||
# Get main package sources
|
||||
cp -r ${SRC}/* ${PKG_BUILD_ROOT}/
|
||||
# Get extra files
|
||||
pull_source ${EXTRA_FILE_SRC1}
|
||||
|
||||
# Get submodules
|
||||
pull_source ${SUBMODULE_SRC1} && \
|
||||
pull_source ${SUBMODULE_SRC2} && \
|
||||
pull_source ${SUBMODULE_SRC3} && \
|
||||
pull_source ${SUBMODULE_SRC4} && \
|
||||
pull_source ${SUBMODULE_SRC5}
|
||||
rc=$(echo $?)
|
||||
if [ "${rc}" != "0" ] ; then
|
||||
exit ${rc}
|
||||
fi
|
||||
|
||||
# Workaround go install issue
|
||||
# case-insensitive import collision: "github.com/sirupsen/logrus" and "github.com/Sirupsen/logrus"
|
||||
# Before implementing the fix by transforming to lowercase Sirupsen, this needs to be tested CentOS side.
|
||||
sed -i 's@github.com/Sirupsen/logrus@github.com/sirupsen/logrus@g' main.go
|
@ -1,7 +1,30 @@
|
||||
---
|
||||
debname: registry-token-server
|
||||
debver: 1.0-1
|
||||
dl_hook: dl_hook
|
||||
src_path: src
|
||||
src_files:
|
||||
- centos/files/token_server.conf
|
||||
dl_files:
|
||||
Sirupsen-logrus-3d4380f53a34dcdc95f0c1db702615992b38d9a4.tar.gz:
|
||||
topdir: Sirupsen-logrus
|
||||
url: github.com/Sirupsen/logrus/archive/3d4380f53a34dcdc95f0c1db702615992b38d9a4.tar.gz
|
||||
md5sum: 5b80ce9a5a54938a598dc65675786142
|
||||
docker-distribution-v2.7.1.tar.gz:
|
||||
topdir: docker-distribution-2.7.1
|
||||
url: https://github.com/docker/distribution/archive/v2.7.1.tar.gz
|
||||
md5sum: 51c06d340d9572bdf7c457f98a521727
|
||||
docker-libtrust-fa567046d9b14f6aa788882a950d69651d230b21.tar.gz:
|
||||
topdir: docker-libtrust
|
||||
url: https://github.com/docker/libtrust/archive/fa567046d9b14f6aa788882a950d69651d230b21.tar.gz
|
||||
md5sum: f8602094367d857ef91eb95d5168ad94
|
||||
gophercloud-gophercloud-aa00757ee3ab58e53520b6cb910ca0543116400a.tar.gz:
|
||||
topdir: gophercloud-gophercloud
|
||||
url: github.com/gophercloud/gophercloud/archive/aa00757ee3ab58e53520b6cb910ca0543116400a.tar.gz
|
||||
md5sum: 1e63645a0d37f3aea3efbd0bd555511e
|
||||
gorilla-mux-599cba5e7b6137d46ddf58fb1765f5d928e69604.tar.gz:
|
||||
topdir: gorilla-mux
|
||||
url: https://github.com/gorilla/mux/archive/599cba5e7b6137d46ddf58fb1765f5d928e69604.tar.gz
|
||||
md5sum: 561c3413396b70e486ceb65177f62c30
|
||||
revision:
|
||||
dist: $STX_DIST
|
||||
PKG_GITREVCOUNT: true
|
||||
|
@ -0,0 +1,32 @@
|
||||
From 29b597c68f14e315c2a5b4f108ca49e4772805b0 Mon Sep 17 00:00:00 2001
|
||||
From: Yue Tao <Yue.Tao@windriver.com>
|
||||
Date: Mon, 22 Nov 2021 07:14:32 -0800
|
||||
Subject: [PATCH] main.go: workaround go install issue
|
||||
|
||||
case-insensitive import collision: "github.com/sirupsen/logrus"
|
||||
and "github.com/Sirupsen/logrus". Before implementing the fix
|
||||
by transforming to lowercase Sirupsen, this needs to be tested
|
||||
CentOS side.
|
||||
|
||||
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
|
||||
Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
|
||||
---
|
||||
main.go | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/main.go b/main.go
|
||||
index aafb069..e71313a 100644
|
||||
--- a/main.go
|
||||
+++ b/main.go
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
- "github.com/Sirupsen/logrus"
|
||||
+ "github.com/sirupsen/logrus"
|
||||
dcontext "github.com/docker/distribution/context"
|
||||
"github.com/docker/distribution/registry/api/errcode"
|
||||
"github.com/docker/distribution/registry/auth"
|
||||
--
|
||||
2.31.1
|
||||
|
1
registry-token-server/debian/patches/series
Normal file
1
registry-token-server/debian/patches/series
Normal file
@ -0,0 +1 @@
|
||||
0001-main.go-workaround-go-install-issue.patch
|
Loading…
x
Reference in New Issue
Block a user