Commit 0c41bf4e authored by Ilya Veselov's avatar Ilya Veselov

debian_files

parent 90745a50
buildscript {
repositories {
maven {
url 'http://artifactory.lan.arta.kz/artifactory/remote-repos/'
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.netflix.nebula:gradle-ospackage-plugin:4.5.1"
classpath 'org.ajoberstar:gradle-git:0.8.0'
}
}
apply plugin: 'base'
apply plugin: 'nebula.ospackage'
description = 'ARTA Synergy Extensions - Import'
ospackage {
def date = new Date();
maintainer = 'Technology Development Department <tdd@arta.pro>'
packageName = 'arta-synergy-extensions-import'
version = 'import_version'
distribution = 'extensions'
packageGroup = 'non-free'
user = 'root'
permissionGroup = 'root'
from("${projectDir}/src") {
into '/'
}
requires('arta-synergy-synergy', '4.0-r1~190130.034722', GREATER | EQUAL)
requires('debconf', '0.5', GREATER | EQUAL).or('debconf-2.0')
postInstallFile file("${projectDir}/debian/postinst")
// supplementaryControl "${projectDir}/debian/templates"
}
build.finalizedBy buildDeb
defaultTasks 'clean', 'build'
#!/bin/sh
set -e
# Source debconf library
. /usr/share/debconf/confmodule
war_setting () {
local war_path="/opt/synergy/extensions/import"
local deployments_path="/opt/synergy/jboss/standalone/deployments"
local version_file="/opt/synergy/versions/arta-synergy-synergy"
local version=$(awk '{print $2}' $version_file | tr -d \(\))
case $version in
"hamming") cp $war_path/hamming/import.war $deployments_path/ ;;
"minsky") cp $war_path/minsky/import.war $deployments_path/ ;;
"master") cp $war_path/minsky/import.war $deployments_path/ ;;
"wilkinson") cp $war_path/minsky/import.war $deployments_path/ ;;
*) echo "Your version is $version, import.war can not be set. Version must be hamming, minsky or wilkinson"
esac
chown jboss:synergy $deployments_path/import.war
touch $deployments_path/import.war.dodeploy
mkdir /tmp/crm-import
chmod 777 -R /tmp/crm-import
}
case "$1" in
configure)
# TODO: Yes, I know we use some kind of kludge here
# But! we need to decide if we include nginx or something to default setup
# then the solution will be more appropriate
war_setting
# Work around problem described here:
# https://lists.debian.org/debian-mentors/2005/11/msg00067.html
#db_stop
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0
#!/bin/bash
set -e
TAR="tar"
CP="cp -v"
PACKAGE_NAME="arta-synergy-extensions-import"
UPSTREAM_VERSION="1.0"
DEFAULT_REPO="extensions"
DEFAULT_URGENCY="low"
AUTHOR="Technology Development Department <tdd@arta.pro>"
CHANGELOG="dpkg/debian/changelog"
SYNERGYPATH="opt/synergy"
JBOSSPATH="${SYNERGYPATH}/jboss"
JBOSSDEPLOY="${JBOSSPATH}/standalone/deployments"
REVISION_LETTER="z"
DESTINATION="${JBOSSDEPLOY}"
DEFAULT_REPO=$1
if [[ $1 == *"master"* ]]
then
DEFAULT_REPO="ier"
REVISION_LETTER="r"
fi
if [[ $1 == *"extensions"* ]]
then
# DEFAULT_REPO="$PRODUCT-$UPSTREAM_VERSION"
REVISION_LETTER="r"
fi
PKG_DIR="PACKAGE"
DSTDIR="${PKG_DIR}/${PACKAGE_NAME}"
VERSIONS_DIR="${DSTDIR}/src/opt/synergy/versions"
BUILD_NUMBER=$(date +"%y%m%d.%H%M%S")
BUILD_TIME=$(date +%F_%H:%m)
PACKAGE_VERSION="${UPSTREAM_VERSION}-${REVISION_LETTER}1~${BUILD_NUMBER}"
rm -rf "${PKG_DIR}"
mkdir -p "${DSTDIR}"
#mkdir -p "${DSTDIR}/src/${DESTINATION}"
mkdir -p "${DSTDIR}/src/${SYNERGYPATH}/extensions/import/hamming"
mkdir -p "${DSTDIR}/src/${SYNERGYPATH}/extensions/import/minsky"
mkdir -p "${DSTDIR}/src/usr/share/doc/${PACKAGE_NAME}"
# For kibana plugins
#mkdir -p "${DSTDIR}/src/usr/share"
#mkdir -p "$VERSIONS_DIR"
$TAR --exclude-vcs -c -C dpkg debian | $TAR xv -C "$DSTDIR"
$CP -a dpkg/Makefile "$DSTDIR"
$CP -a "wars/hamming/import.war" "${DSTDIR}/src/${SYNERGYPATH}/extensions/import/hamming"
$CP -a "wars/minsky/import.war" "${DSTDIR}/src/${SYNERGYPATH}/extensions/import/minsky"
$CP -a "dpkg/debian/copyright" "${DSTDIR}/src/usr/share/doc/${PACKAGE_NAME}"
$CP -a "dpkg/build.gradle" "${DSTDIR}"
# Generating changelog entry
rm -f "$DSTDIR/changelog.entry"
touch "$DSTDIR/changelog.entry"
echo "$PACKAGE_NAME ($PACKAGE_VERSION) ${DEFAULT_REPO}; urgency=${DEFAULT_URGENCY}" >> "$DSTDIR/changelog.entry"
echo "" >> "$DSTDIR/changelog.entry" >> "$DSTDIR/changelog.entry"
echo " * Automatic build with number ${BUILD_NUMBER} ($BUILD_TIME)" >> "$DSTDIR/changelog.entry"
echo "" >> "${DSTDIR}/changelog.entry"
echo " -- ${AUTHOR} $(date -R)" >> "$DSTDIR/changelog.entry"
echo "" >> "$DSTDIR/changelog.entry"
sed -i 's/import_version/'"$PACKAGE_VERSION"'/' "${DSTDIR}/build.gradle"
cat "$DSTDIR/changelog.entry" $CHANGELOG > "$DSTDIR/debian/changelog"
rm "$DSTDIR/changelog.entry"
$CP -a "$DSTDIR/debian/changelog" "$DSTDIR/src/usr/share/doc/${PACKAGE_NAME}/changelog.Debian"
gzip "$DSTDIR/src/usr/share/doc/${PACKAGE_NAME}/changelog.Debian"
mkdir -p $VERSIONS_DIR
echo "$PACKAGE_VERSION ($1)" > "$VERSIONS_DIR/$PACKAGE_NAME"
Markdown is supported
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