Skip to content
Snippets Groups Projects
Commit 68083554 authored by Pavel Vondruška's avatar Pavel Vondruška
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
image: debian:stretch
# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
variables:
DEBEMAIL: "Pavel Vondruska <dexter.cz@gmail.com>"
# Defines stages which are to be executed
stages:
- build
# Stage "build"
run-build:
stage: build
script:
- ./make.sh
# This stage is only executed if commited to master
only:
- master
# The files which are to be made available in GitLab
artifacts:
paths:
- build/*
make.sh 0 → 100755
#!/bin/bash -x
apt update -qqq
apt install gcc python-dev virtualenv libkrb5-dev curl patch --no-install-recommends -qqq
virtualenv /opt/swiftclient
source /opt/swiftclient/bin/activate
pip install python-swiftclient requests-kerberos
curl https://github.com/openstack/python-swiftclient/commit/3e248bc679fa5ec6825d534c1afc9b2966e238f5.patch | patch -f -p1 -d /opt/swiftclient/lib/python2.7/site-packages/
VER=`pip list --format=legacy | grep -Po "python-swiftclient \(\K[\d\.]+"`
SIZE=`du -ks /opt/swiftclient | cut -f1`
WORKDIR=python-swiftclient-kerberos
mkdir -p $WORKDIR/DEBIAN
mkdir -p $WORKDIR/usr/bin
mv /opt $WORKDIR
cat > $WORKDIR/DEBIAN/control <<EOF
Package: python-swiftclient-kerberos
Version: ${VER}-1+deb9+dex1
Architecture: all
Maintainer: Pavel Vondruska <vondruska@cesnet.cz>
Installed-Size: $SIZE
Depends: python | python2.7 | python3
Replaces: swift (<< 1.6.0)
Conflicts: python-swiftclient, python3-swiftclient
Section: python
Priority: extra
Homepage: https://github.com/openstack/python-swiftclient
Description: Client library for Openstack Swift API
OpenStack Object Storage (code-named Swift) creates redundant, scalable object
storage using clusters of standardized servers to store petabytes of
accessible data. It is not a file system or real-time data storage system, but
rather a long-term storage system for a more permanent type of static data
that can be retrieved, leveraged, and then updated if necessary. Primary
examples of data that best fit this type of storage model are virtual machine
images, photo storage, email storage and backup archiving. Having no central
"brain" or master point of control provides greater scalability, redundancy
and permanence.
.
Objects are written to multiple hardware devices in the data center, with
the OpenStack software responsible for ensuring data replication and
integrity across the cluster. Storage clusters can scale horizontally by
adding new nodes. Should a node fail, OpenStack works to replicate its
content from other active nodes. Because OpenStack uses software logic to
ensure data replication and distribution across different devices,
inexpensive commodity hard drives and servers can be used in lieu of more
expensive equipment.
.
This package provides a client for the OpenStack Swift API. There's a Python
API (the "swiftclient" module), and a command-line script ("swift").
.
This package contains patch for Kerberos authentication.
EOF
cat > $WORKDIR/usr/bin/swift <<EOSWIFT
#!/bin/bash
if [ "\$ST_KRB" == 1 ]; then
export ST_USER=user
export ST_KEY=key
SWIFTARGS=--kerberos
fi
source /opt/swiftclient/bin/activate
swift \$SWIFTARGS \$*
EOSWIFT
chmod +x $WORKDIR/usr/bin/swift
dpkg-deb -b $WORKDIR python-swiftclient-kerberos_${VER}-1+dex1.deb
mkdir build
mv *.deb build/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment