Merge "Add debian package for registry-token-server"
This commit is contained in:
commit
fedb99c424
1
debian_pkg_dirs
Normal file
1
debian_pkg_dirs
Normal file
@ -0,0 +1 @@
|
|||||||
|
registry-token-server
|
5
registry-token-server/debian/deb_folder/changelog
Normal file
5
registry-token-server/debian/deb_folder/changelog
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
registry-token-server (1.0-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Initial release.
|
||||||
|
|
||||||
|
-- Dan Voiculeasa <dan.voiculeasa@windriver.com> Wed, 18 Aug 2021 14:41:40 -0400
|
17
registry-token-server/debian/deb_folder/control
Normal file
17
registry-token-server/debian/deb_folder/control
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
Source: registry-token-server
|
||||||
|
Section: admin
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
|
||||||
|
Build-Depends: debhelper-compat (= 13),
|
||||||
|
dh-golang,
|
||||||
|
golang-any (>= 2:1.13~)
|
||||||
|
Standards-Version: 4.4.1
|
||||||
|
XS-Go-Import-Path: registry-token-server
|
||||||
|
|
||||||
|
Package: registry-token-server
|
||||||
|
Architecture: amd64
|
||||||
|
Multi-Arch: no
|
||||||
|
Depends: ${misc:Depends},
|
||||||
|
${shlibs:Depends}
|
||||||
|
Description: Token server
|
||||||
|
Token server for use with Docker registry with Openstack Keystone backend
|
28
registry-token-server/debian/deb_folder/copyright
Normal file
28
registry-token-server/debian/deb_folder/copyright
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Upstream-Name: registry-token-server
|
||||||
|
Source: https://opendev.org/starlingx/containers
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: (c) 2018-2021 Wind River Systems, Inc
|
||||||
|
(c) 2019 Intel Corporation
|
||||||
|
License: Apache-2
|
||||||
|
|
||||||
|
Files: debian/*
|
||||||
|
Copyright: 2021 Wind River Systems, Inc
|
||||||
|
License: Apache-2
|
||||||
|
|
||||||
|
License: Apache-2
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
.
|
||||||
|
https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
.
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
.
|
||||||
|
On Debian-based systems the full text of the Apache version 2.0 license
|
||||||
|
can be found in `/usr/share/common-licenses/Apache-2.0'.
|
@ -0,0 +1 @@
|
|||||||
|
LICENSE
|
@ -0,0 +1 @@
|
|||||||
|
token_server.conf etc/registry-token-server/registry/
|
@ -0,0 +1 @@
|
|||||||
|
no-manual-page
|
@ -0,0 +1,19 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=v2 Registry token server for Docker
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
EnvironmentFile=/etc/docker-distribution/registry/token_server.conf
|
||||||
|
ExecStart=/usr/bin/registry-token-server -addr=${REGISTRY_TOKEN_SERVER_ADDR} \
|
||||||
|
-issuer=${REGISTRY_TOKEN_SERVER_ISSUER} \
|
||||||
|
-endpoint=${REGISTRY_TOKEN_SERVER_KS_ENDPOINT} \
|
||||||
|
-tlscert=${REGISTRY_TOKEN_SERVER_TLSCERT} \
|
||||||
|
-tlskey=${REGISTRY_TOKEN_SERVER_TLSKEY} \
|
||||||
|
-realm=${REGISTRY_TOKEN_SERVER_REALM} \
|
||||||
|
-key=${REGISTRY_TOKEN_SERVER_KEY}
|
||||||
|
Restart=on-failure
|
||||||
|
ExecStartPost=/bin/bash -c 'echo $MAINPID > /var/run/registry-token-server.pid'
|
||||||
|
ExecStopPost=/bin/rm -f /var/run/registry-token-server.pid
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
31
registry-token-server/debian/deb_folder/rules
Executable file
31
registry-token-server/debian/deb_folder/rules
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
# See debhelper(7) (uncomment to enable)
|
||||||
|
# output every command that modifies files on the build system.
|
||||||
|
export DH_VERBOSE = 1
|
||||||
|
|
||||||
|
export DH_GOLANG_GO_GENERATE := 1
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@ --builddirectory=_build --buildsystem=golang --with=golang
|
||||||
|
|
||||||
|
override_dh_auto_build:
|
||||||
|
# Can't unpack in download hook step, because debian build system will mess the go build environment
|
||||||
|
gzip -dc Sirupsen-logrus-3d4380f53a34dcdc95f0c1db702615992b38d9a4.tar.gz | tar -xvvf -
|
||||||
|
gzip -dc docker-distribution-v2.7.1.tar.gz | tar -xvvf -
|
||||||
|
gzip -dc docker-libtrust-fa567046d9b14f6aa788882a950d69651d230b21.tar.gz | tar -xvvf -
|
||||||
|
gzip -dc gophercloud-gophercloud-aa00757ee3ab58e53520b6cb910ca0543116400a.tar.gz | tar -xvvf -
|
||||||
|
gzip -dc gorilla-mux-599cba5e7b6137d46ddf58fb1765f5d928e69604.tar.gz | tar -xvvf -
|
||||||
|
|
||||||
|
rm Sirupsen-logrus-3d4380f53a34dcdc95f0c1db702615992b38d9a4.tar.gz
|
||||||
|
rm docker-distribution-v2.7.1.tar.gz
|
||||||
|
rm docker-libtrust-fa567046d9b14f6aa788882a950d69651d230b21.tar.gz
|
||||||
|
rm gophercloud-gophercloud-aa00757ee3ab58e53520b6cb910ca0543116400a.tar.gz
|
||||||
|
rm gorilla-mux-599cba5e7b6137d46ddf58fb1765f5d928e69604.tar.gz
|
||||||
|
|
||||||
|
mkdir -p _build/src/github.com/gorilla/ && mv gorilla-mux _build/src/github.com/gorilla/mux
|
||||||
|
mkdir -p _build/src/github.com/docker/ && mv docker-distribution-2.7.1 _build/src/github.com/docker/distribution
|
||||||
|
mkdir -p _build/src/github.com/docker/ && mv docker-libtrust _build/src/github.com/docker/libtrust
|
||||||
|
mkdir -p _build/src/github.com/sirupsen/ && mv Sirupsen-logrus _build/src/github.com/sirupsen/logrus
|
||||||
|
mkdir -p _build/src/github.com/gophercloud && mv gophercloud-gophercloud _build/src/github.com/gophercloud/gophercloud
|
||||||
|
|
||||||
|
dh_auto_build
|
1
registry-token-server/debian/deb_folder/source/format
Normal file
1
registry-token-server/debian/deb_folder/source/format
Normal file
@ -0,0 +1 @@
|
|||||||
|
3.0 (quilt)
|
55
registry-token-server/debian/dl_hook
Executable file
55
registry-token-server/debian/dl_hook
Executable file
@ -0,0 +1,55 @@
|
|||||||
|
#!/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
|
7
registry-token-server/debian/meta_data.yaml
Normal file
7
registry-token-server/debian/meta_data.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
debname: registry-token-server
|
||||||
|
debver: 1.0-1
|
||||||
|
dl_hook: dl_hook
|
||||||
|
revision:
|
||||||
|
dist: $STX_DIST
|
||||||
|
PKG_GITREVCOUNT: true
|
Loading…
x
Reference in New Issue
Block a user