Verified Commit 5c06dfdd authored by Frederik Enste's avatar Frederik Enste
Browse files

prepared debian package

parent 266608ac
Pipeline #94 created
pipeline {
agent {
label 'debian'
}
environment {
packageName = "teco-pve-ldap-sync"
packageVersion = "1.0"
}
options {
gitLabConnection('GitLab Teco')
}
triggers {
gitlab(triggerOnPush: true, triggerOnMergeRequest: true, branchFilterType: 'All')
}
post {
failure {
updateGitlabCommitStatus name: 'build', state: 'failed'
}
success {
updateGitlabCommitStatus name: 'build', state: 'success'
}
}
stages {
stage('Prepare') {
steps {
checkout scm
sh '''
git reset --hard HEAD
git clean -d --force
'''
}
}
stage('Package') {
steps {
sh 'debuild -us -uc'
}
}
stage('PackageInspect') {
steps {
sh '''
TEMP_DIR=`mktemp --directory`
cd root && cp --recursive . "${TEMP_DIR}" && cd ..
find "${TEMP_DIR}" -type f -exec sha256sum "{}" + > sources.sum
rm --recursive --force "${TEMP_DIR}"
mkdir "${TEMP_DIR}"
dpkg --extract "../${packageName}_${packageVersion}_all.deb" "${TEMP_DIR}"
rm "${TEMP_DIR}/usr/share/doc/teco-pve-autoremove-subscription-message/changelog.gz"
rm "${TEMP_DIR}/usr/share/doc/teco-pve-autoremove-subscription-message/copyright"
find "${TEMP_DIR}" -type f -exec sha256sum "{}" + > content.sum
rm --recursive --force "${TEMP_DIR}"
cat sources.sum
cat content.sum
diff sources.sum content.sum
'''
}
}
stage('Deploy') {
when {
expression {
TAG = sh(returnStdout: true, script: 'git describe --tags --exact-match | grep -c release || true').trim()
return TAG == '1'
}
}
steps {
withCredentials([usernamePassword(credentialsId: 'registry', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh 'curl -u "${USER}:${PASS}" -H "Content-Type: multipart/form-data" --data-binary "@../${packageName}_${packageVersion}_all.deb" "https://registry.teco.edu/repository/debian/"'
}
}
}
}
}
This diff is collapsed.
build:
# only scripts; no build needed
install:
install -D -m 0755 root/usr/share/teco/pve-ldap-sync $(DESTDIR)/usr/share/teco/pve-ldap-sync
uninstall:
rm $(DESTDIR)/usr/share/teco/pve-ldap-sync
rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/teco
\ No newline at end of file
# TECO PVE LDAP Sync
This package should, once installed, provide a python script to sync the TECO's LDAP to the Proxmox user database.
It is required to be run periodically.
In order to function the script needs a login for the Proxmox Web API with `PVEUserAdmin` rights for `/access`.
# Build
Clone the Repo and install all dependencies:
```bash
apt-get install --yes --no-install-recommends --no-install-suggests devscripts build-essential debhelper curl gpg
```
If you want to sign your work import the `TECO IT <it@teco.edu>` GPG key:
```bash
gpg --batch --import teco-it-private.gpg.key
gpg --import-ownertrust teco-it-ownertrust.gpg
```
For a signed build simply use `debuild` and use `debuild -uc -us` for an unsigned build.
teco-pve-autoremove-subscription-message (1.0) stable; urgency=low
* Initial Release.
-- TECO IT <it@teco.edu> Sat, 06 Dec 2020 03:38:52 +0000
Source: teco-pve-ldap-sync
Section: admin
Priority: optional
Maintainer: TECO IT <it@teco.edu>
Build-Depends: debhelper (>= 11),gpg (>= 2.2)
Standards-Version: 4.1.3
Homepage: https://teco.edu/
Vcs-Browser: https://gitlab.teco.edu/it/debian/teco-pve-ldap-sync
Vcs-Git: https://gitlab.teco.edu/it/debian/teco-pve-ldap-sync.git
Package: teco-pve-ldap-sync
Architecture: all
Depends: python3-ldap (>= 3.2.0), python3-requests (>= 2.21.0), python3-proxmoxer (>= 1.0.3), ${shlibs:Depends}, ${misc:Depends}
Description: Provides LDAP to Proxmox user sync helpers.
This package provides a script to synchronize the
TECO LDAP users and groups to the Proxmox user database
via its Web API.
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: teco-pve-autoremove-subscription-message
Source: https://gitlab.teco.edu/it/debian/teco-pve-ldap-sync
Files: *
Copyright: Frederik Enste <frederik@fenste.de>
License: GPL-3.0+
Files: debian/*
Copyright: 2020 Debian <it@teco.edu>
License: GPL-3.0+
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid picking licenses with terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
3.0 (native)
\ No newline at end of file
......@@ -191,7 +191,6 @@ def sync_add_user(proxmox: ProxmoxAPI, user: dict):
firstname=user['firstname'],
email=user['email'],
groups=user['groups'])
return None
def sync_update_user(proxmox: ProxmoxAPI, user: dict, reference: dict):
......@@ -222,7 +221,6 @@ def sync_update_user(proxmox: ProxmoxAPI, user: dict, reference: dict):
firstname=user['firstname'],
email=user['email'],
groups=user['groups'])
return None
def sync_delete_user(proxmox: ProxmoxAPI, user: dict):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment