build all in docker
This commit is contained in:
48
ChangeLog
48
ChangeLog
@@ -1,3 +1,51 @@
|
|||||||
|
2015-12-02 15:58 marc
|
||||||
|
|
||||||
|
* build-in-docker.conf, build-in-docker.sh,
|
||||||
|
resolve-debbuilddeps.sh: enhanced build in docker
|
||||||
|
|
||||||
|
2015-12-02 07:17 marc
|
||||||
|
|
||||||
|
* build-in-docker.conf: build requires universe for npm
|
||||||
|
|
||||||
|
2015-12-01 14:50 marc
|
||||||
|
|
||||||
|
* build-in-docker.conf, build-in-docker.sh, debian/control.in:
|
||||||
|
improved dependencies for more ubuntu support
|
||||||
|
|
||||||
|
2015-12-01 13:10 marc
|
||||||
|
|
||||||
|
* build-in-docker.conf: build everything in docker now, 2nd try
|
||||||
|
|
||||||
|
2015-12-01 12:17 marc
|
||||||
|
|
||||||
|
* bootstrap.sh, build-in-docker.conf, build-in-docker.sh,
|
||||||
|
configure.ac, makefile.am: build everithing in docker now
|
||||||
|
|
||||||
|
2015-11-25 15:25 marc
|
||||||
|
|
||||||
|
* build-in-docker.sh: allow add repositories (for cordova-cli)
|
||||||
|
|
||||||
|
2015-11-25 12:45 marc
|
||||||
|
|
||||||
|
* configure.ac, debian/control.in: install cordova from ubuntu ppa
|
||||||
|
|
||||||
|
2015-11-25 10:05 marc
|
||||||
|
|
||||||
|
* configure.ac, cordova/makefile.am, debian/control.in: fixes for
|
||||||
|
cordova
|
||||||
|
|
||||||
|
2015-11-25 08:57 marc
|
||||||
|
|
||||||
|
* ax_init_standard_project.m4, bootstrap.sh, configure.ac,
|
||||||
|
debian/control.in, sql-to-dot.sed: check for android and cordova
|
||||||
|
separately; depend on npm and nodejs for cordova
|
||||||
|
|
||||||
|
2015-11-20 14:05 marc
|
||||||
|
|
||||||
|
* ChangeLog, cordova/config.xml.in, cordova/makefile.am,
|
||||||
|
html/safechat.js, safechat.desktop.in: try to allow background
|
||||||
|
process
|
||||||
|
|
||||||
2015-11-09 22:34 marc
|
2015-11-09 22:34 marc
|
||||||
|
|
||||||
* html/documentation.dox, html/makefile.am: added missing doc
|
* html/documentation.dox, html/makefile.am: added missing doc
|
||||||
|
@@ -1,11 +1,22 @@
|
|||||||
|
# if you have android, we need cordova plus more dependencies
|
||||||
|
# so we can build an android app
|
||||||
|
if test -n "${ANDROID_HOME}"; then
|
||||||
|
# all this is needed for android through cordova (phonegap) only
|
||||||
packages+=("wheezy:::curl:::npm")
|
packages+=("wheezy:::curl:::npm")
|
||||||
packages+=("nodejs")
|
packages+=("git nodejs default-jdk libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1")
|
||||||
repos+=("Ubuntu:::universe")
|
repos+=("Ubuntu-precise:::'deb http://archive.ubuntu.com precise universe'")
|
||||||
|
repos+=("Debian|Ubuntu-precise::::::universe")
|
||||||
repos+=("wheezy:::'deb http://ftp.is.debian.org/debian wheezy-backports main'")
|
repos+=("wheezy:::'deb http://ftp.is.debian.org/debian wheezy-backports main'")
|
||||||
commands+=("wheezy:::update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100")
|
commands+=("update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100")
|
||||||
commands+=("wheezy:::curl https://www.npmjs.com/install.sh | sh")
|
commands+=("wheezy:::curl https://www.npmjs.com/install.sh | sh")
|
||||||
commands+=("npm install -g cordova")
|
commands+=("npm install -g cordova")
|
||||||
if test -n "${ANDROID_HOME}"; then
|
commands+=("chown $(id -u) ${HOME}")
|
||||||
|
commands+=("chown -R $(id -u) ${HOME}/.npm")
|
||||||
|
commands+=("useradd -d ${HOME} -u $(id -u) $(id -un)")
|
||||||
envs+=("-e ANDROID_HOME=${ANDROID_HOME}")
|
envs+=("-e ANDROID_HOME=${ANDROID_HOME}")
|
||||||
|
envs+=("-e HOME=${HOME}")
|
||||||
|
envs+=("-e TERM=xterm")
|
||||||
dirs+=("-v ${ANDROID_HOME}:${ANDROID_HOME}:ro")
|
dirs+=("-v ${ANDROID_HOME}:${ANDROID_HOME}:ro")
|
||||||
|
dirs+=("-v ${HOME}/.gnupg:${HOME}/.gnupg:ro")
|
||||||
|
dirs+=("-v ${HOME}/.android:${HOME}/.android:ro")
|
||||||
fi
|
fi
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
#! /bin/bash -e
|
#! /bin/bash -e
|
||||||
|
set -o errtrace
|
||||||
|
|
||||||
# build and test everything in a fresh docker installation
|
# build and test everything in a fresh docker installation
|
||||||
img="ubuntu:latest"
|
img="ubuntu:latest"
|
||||||
@@ -39,10 +40,10 @@ while test $# -gt 0; do
|
|||||||
echo " <os>:::<A>"
|
echo " <os>:::<A>"
|
||||||
echo " Read as: On linux type <os> use <A> else use <B>"
|
echo " Read as: On linux type <os> use <A> else use <B>"
|
||||||
echo " That means: If the distributer ID or codename in lsb_release"
|
echo " That means: If the distributer ID or codename in lsb_release"
|
||||||
echo " matches <os>, then <A> is replaced, else <B> is replaced."
|
echo " matches regular expression <os>, then <A> is replaced, else <B> is replaced."
|
||||||
echo " The three colons are for splitting <os> from <A> and <B> part."
|
echo " The three colons are for splitting <os> from <A> and <B> part."
|
||||||
echo " E.g.: Install package curl on wheezy and npm on olter systems:"
|
echo " E.g.: Install package curl on wheezy and npm on olter systems:"
|
||||||
echo " $0 -p wheezy:::curl:::npm"
|
echo " $0 -p Debian|precise:::curl:::npm"
|
||||||
echo
|
echo
|
||||||
echo "EXAMPLE:"
|
echo "EXAMPLE:"
|
||||||
echo
|
echo
|
||||||
@@ -93,6 +94,38 @@ while test $# -gt 0; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
function traperror() {
|
||||||
|
set +x
|
||||||
|
local DOCKER_ID="$1"
|
||||||
|
local err=($2) # error status
|
||||||
|
local line="$3" # LINENO
|
||||||
|
local linecallfunc="$4"
|
||||||
|
local command="$5"
|
||||||
|
local funcstack="$6"
|
||||||
|
for e in ${err[@]}; do
|
||||||
|
if test -n "$e" -a "$e" != "0"; then
|
||||||
|
echo "<---"
|
||||||
|
echo "ERROR: line $line - command '$command' exited with status: $e (${err[@]})"
|
||||||
|
if [ "${funcstack}" != "main" -o "$linecallfunc" != "0" ]; then
|
||||||
|
echo -n " ... Error at ${funcstack} "
|
||||||
|
if [ "$linecallfunc" != "" ]; then
|
||||||
|
echo -n "called at line $linecallfunc"
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
echo "**** Entering docker container ${DOCKER_ID}, exit with Ctrl-D"
|
||||||
|
echo -n " ... cleanup docker: "
|
||||||
|
docker rm -f "${DOCKER_ID}"
|
||||||
|
echo "returning status: $e"
|
||||||
|
echo "--->"
|
||||||
|
exit $e
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo -n " SUCCESS ... cleanup docker: "
|
||||||
|
docker rm -f "${DOCKER_ID}"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
function ifthenelse() {
|
function ifthenelse() {
|
||||||
arg="$1"
|
arg="$1"
|
||||||
shift
|
shift
|
||||||
@@ -103,24 +136,29 @@ function ifthenelse() {
|
|||||||
os="${arg%%:::*}"
|
os="${arg%%:::*}"
|
||||||
thenpart="${arg#*:::}"
|
thenpart="${arg#*:::}"
|
||||||
if test "${thenpart/:::/}" = "${thenpart}"; then
|
if test "${thenpart/:::/}" = "${thenpart}"; then
|
||||||
docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if test "${os//$(lsb_release -is)/}${os//$(lsb_release -cs)/}" != "${os}${os}"; then '"${cmd//ARG/${thenpart}}"'; fi'
|
docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if [[ "$(lsb_release -is)-$(lsb_release -cs)" =~ ${os} ]]; then '"${cmd//ARG/${thenpart}}"'; fi'
|
||||||
else
|
else
|
||||||
elsepart="${thenpart##*:::}"
|
elsepart="${thenpart##*:::}"
|
||||||
thenpart="${thenpart%:::*}"
|
thenpart="${thenpart%:::*}"
|
||||||
docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if test "${os//$(lsb_release -is)/}${os//$(lsb_release -cs)/}" != "${os}${os}"; then '"${cmd//ARG/${thenpart}}"'; else '"${cmd//ARG/${elsepart}}"'; fi'
|
if test -n "${thenpart}"; then
|
||||||
|
docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if [[ "$(lsb_release -is)-$(lsb_release -cs)" =~ ${os} ]]; then '"${cmd//ARG/${thenpart}}"'; else '"${cmd//ARG/${elsepart}}"'; fi'
|
||||||
|
else
|
||||||
|
docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if [[ "$(lsb_release -is)-$(lsb_release -cs)" =~ ${os} ]]; then true; else '"${cmd//ARG/${elsepart}}"'; fi'
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
docker pull $img
|
||||||
DOCKER_ID=$(docker run -d ${dirs[@]} ${envs[@]} -w /workdir $img sleep infinity)
|
DOCKER_ID=$(docker run -d ${dirs[@]} ${envs[@]} -w /workdir $img sleep infinity)
|
||||||
trap "docker rm -f ${DOCKER_ID}" INT TERM EXIT
|
trap 'traperror '"${DOCKER_ID}"' "$? ${PIPESTATUS[@]}" $LINENO $BASH_LINENO "$BASH_COMMAND" "${FUNCNAME[@]}" "${FUNCTION}"' SIGINT INT TERM EXIT
|
||||||
docker exec ${DOCKER_ID} apt-get update
|
docker exec ${DOCKER_ID} apt-get update
|
||||||
docker exec ${DOCKER_ID} apt-get upgrade -y --force-yes
|
docker exec ${DOCKER_ID} apt-get upgrade -y
|
||||||
if ! docker exec ${DOCKER_ID} apt-get install -y --force-yes python-software-properties apt-transport-https dpkg-dev lsb-release; then
|
docker exec ${DOCKER_ID} apt-get install -y python-software-properties software-properties-common apt-transport-https dpkg-dev lsb-release || \
|
||||||
docker exec ${DOCKER_ID} apt-get install -y --force-yes software-properties-common apt-transport-https dpkg-dev lsb-release
|
docker exec ${DOCKER_ID} apt-get install -y software-properties-common apt-transport-https dpkg-dev lsb-release || \
|
||||||
fi
|
docker exec ${DOCKER_ID} apt-get install -y python-software-properties apt-transport-https dpkg-dev lsb-release;
|
||||||
for repo in "${repos[@]}"; do
|
for repo in "${repos[@]}"; do
|
||||||
ifthenelse "${repo}" "apt-add-repository ARG"
|
ifthenelse "${repo}" "apt-add-repository ARG"
|
||||||
done
|
done
|
||||||
|
@@ -19,13 +19,13 @@ ${ANDROID_SRC}:
|
|||||||
( cp -r "@srcdir@/$${file}" "$${file}" && \
|
( cp -r "@srcdir@/$${file}" "$${file}" && \
|
||||||
chmod -R u+w "$${file}" ); \
|
chmod -R u+w "$${file}" ); \
|
||||||
done
|
done
|
||||||
if [ "$$(whoami)" != "root" ]; then \
|
if [ "$$(whoami 2> /dev/null)" != "root" ]; then \
|
||||||
${CORDOVA} plugin add https://github.com/katzer/cordova-plugin-background-mode.git; \
|
${CORDOVA} plugin add https://github.com/katzer/cordova-plugin-background-mode.git; \
|
||||||
${CORDOVA} build --debug || ${CORDOVA} build --debug; \
|
${CORDOVA} build --debug || ${CORDOVA} build --debug; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${ANDROID}: ${ANDROID_SRC}
|
${ANDROID}: ${ANDROID_SRC}
|
||||||
if [ "$$(whoami)" != "root" ]; then \
|
if [ "$$(whoami 2> /dev/null)" != "root" ]; then \
|
||||||
cp $< $@; \
|
cp $< $@; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<manifest android:hardwareAccelerated="true" android:versionCode="346" android:versionName="0.3.46" package="ch.safechat" xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest android:hardwareAccelerated="true" android:versionCode="359" android:versionName="0.3.59" package="ch.safechat" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
|
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<service android:name="de.appplant.cordova.plugin.background.ForegroundService" />
|
||||||
</application>
|
</application>
|
||||||
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="22" />
|
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="22" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -3,13 +3,33 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
"file": "plugins/cordova-plugin-whitelist/whitelist.js",
|
"file": "plugins/cordova-plugin-whitelist/whitelist.js",
|
||||||
"id": "cordova-plugin-whitelist.whitelist",
|
"id": "cordova-plugin-whitelist.whitelist",
|
||||||
|
"pluginId": "cordova-plugin-whitelist",
|
||||||
"runs": true
|
"runs": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "plugins/cordova-plugin-device/www/device.js",
|
||||||
|
"id": "cordova-plugin-device.device",
|
||||||
|
"pluginId": "cordova-plugin-device",
|
||||||
|
"clobbers": [
|
||||||
|
"device"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "plugins/de.appplant.cordova.plugin.background-mode/www/background-mode.js",
|
||||||
|
"id": "de.appplant.cordova.plugin.background-mode.BackgroundMode",
|
||||||
|
"pluginId": "de.appplant.cordova.plugin.background-mode",
|
||||||
|
"clobbers": [
|
||||||
|
"cordova.plugins.backgroundMode",
|
||||||
|
"plugin.backgroundMode"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
module.exports.metadata =
|
module.exports.metadata =
|
||||||
// TOP OF METADATA
|
// TOP OF METADATA
|
||||||
{
|
{
|
||||||
"cordova-plugin-whitelist": "1.0.0"
|
"cordova-plugin-whitelist": "1.0.0",
|
||||||
|
"cordova-plugin-device": "1.1.0",
|
||||||
|
"de.appplant.cordova.plugin.background-mode": "0.6.4"
|
||||||
}
|
}
|
||||||
// BOTTOM OF METADATA
|
// BOTTOM OF METADATA
|
||||||
});
|
});
|
@@ -1,10 +1,17 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<widget id="ch.safechat" version="0.3.46" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
<widget id="ch.safechat" version="0.3.59" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||||
<preference name="loglevel" value="DEBUG" />
|
<preference name="loglevel" value="DEBUG" />
|
||||||
<feature name="Whitelist">
|
<feature name="Whitelist">
|
||||||
<param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
|
<param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
|
||||||
<param name="onload" value="true" />
|
<param name="onload" value="true" />
|
||||||
</feature>
|
</feature>
|
||||||
|
<feature name="Device">
|
||||||
|
<param name="android-package" value="org.apache.cordova.device.Device" />
|
||||||
|
</feature>
|
||||||
|
<feature name="BackgroundMode">
|
||||||
|
<param name="android-package" value="de.appplant.cordova.plugin.background.BackgroundMode" />
|
||||||
|
</feature>
|
||||||
|
<preference name="KeepRunning" value="true" />
|
||||||
<allow-intent href="market:*" />
|
<allow-intent href="market:*" />
|
||||||
<name>SafeChat</name>
|
<name>SafeChat</name>
|
||||||
<description>
|
<description>
|
||||||
|
@@ -20,7 +20,14 @@
|
|||||||
"installed_plugins": {
|
"installed_plugins": {
|
||||||
"cordova-plugin-whitelist": {
|
"cordova-plugin-whitelist": {
|
||||||
"PACKAGE_NAME": "ch.safechat"
|
"PACKAGE_NAME": "ch.safechat"
|
||||||
|
},
|
||||||
|
"de.appplant.cordova.plugin.background-mode": {
|
||||||
|
"PACKAGE_NAME": "ch.safechat"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependent_plugins": {}
|
"dependent_plugins": {
|
||||||
|
"cordova-plugin-device": {
|
||||||
|
"PACKAGE_NAME": "ch.safechat"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@@ -6,5 +6,22 @@
|
|||||||
},
|
},
|
||||||
"is_top_level": true,
|
"is_top_level": true,
|
||||||
"variables": {}
|
"variables": {}
|
||||||
|
},
|
||||||
|
"de.appplant.cordova.plugin.background-mode": {
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/katzer/cordova-plugin-background-mode.git",
|
||||||
|
"subdir": "."
|
||||||
|
},
|
||||||
|
"is_top_level": true,
|
||||||
|
"variables": {}
|
||||||
|
},
|
||||||
|
"cordova-plugin-device": {
|
||||||
|
"source": {
|
||||||
|
"type": "registry",
|
||||||
|
"id": "cordova-plugin-device"
|
||||||
|
},
|
||||||
|
"is_top_level": false,
|
||||||
|
"variables": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE HTML">
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
Reference in New Issue
Block a user