Merge pull request #3338 from taosdata/feature/sangshuduo/snap

Feature/sangshuduo/snap
This commit is contained in:
Shengliang Guan 2020-09-02 09:40:49 +08:00 committed by GitHub
commit 9b9ea6661a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 16 deletions

View File

@ -5,7 +5,9 @@ if [ ! -d /var/lib/taos ]; then
fi fi
if [ ! -d /var/log/taos ]; then if [ ! -d /var/log/taos ]; then
mkdir -p -m777 /var/log/taos mkdir -p --mode=777 /var/log/taos
else
chmod 777 /var/log/taos
fi fi
if [ ! -d /etc/taos ]; then if [ ! -d /etc/taos ]; then
@ -13,5 +15,8 @@ if [ ! -d /etc/taos ]; then
fi fi
if [ ! -f /etc/taos/taos.cfg ]; then if [ ! -f /etc/taos/taos.cfg ]; then
if [ ! -d /etc/taos ]; then
mkdir -p /etc/taos
fi
cp $SNAP/etc/taos/taos.cfg /etc/taos/taos.cfg cp $SNAP/etc/taos/taos.cfg /etc/taos/taos.cfg
fi fi

View File

@ -15,11 +15,12 @@ case "$SNAP_USER_COMMON" in
*) COMMON=$SNAP_USER_COMMON ;; *) COMMON=$SNAP_USER_COMMON ;;
esac esac
if [ -d /etc/taos ]; then if [ ! -f $SNAP_DATA/etc/taos/taos.cfg ]; then
CONFIG_FILE="/etc/taos" if [ ! -d $SNAP_DATA/etc/taos ]; then
else mkdir -p $SNAP_DATA/etc/taos
CONFIG_FILE="$SNAP/etc/taos" fi
cp $SNAP/etc/taos/taos.cfg $SNAP_DATA/etc/taos
fi fi
# Launch the snap # Launch the snap
$SNAP/usr/bin/taosd -c $CONFIG_FILE $@ $SNAP/usr/bin/taosd -c /etc/taos $@

View File

@ -1,13 +1,13 @@
name: tdengine name: tdengine
base: core18 # the base snap is the execution environment for this snap base: core18 # the base snap is the execution environment for this snap
version: '2.0.0.6' # just for humans, typically '1.2+git' or '1.3.2' version: '2.0.2.0' # just for humans, typically '1.2+git' or '1.3.2'
icon: snap/gui/t-dengine.svg icon: snap/gui/t-dengine.svg
summary: an open-source big data platform designed and optimized for IoT. summary: an open-source big data platform designed and optimized for IoT.
description: | description: |
TDengine is an open-source big data platform designed and optimized for Internet of Things (IoT), Connected Vehicles, and Industrial IoT. Besides the 10x faster time-series database, it provides caching, stream computing, message queuing and other functionalities to reduce the complexity and costs of development and operations. TDengine is an open-source big data platform designed and optimized for Internet of Things (IoT), Connected Vehicles, and Industrial IoT. Besides the 10x faster time-series database, it provides caching, stream computing, message queuing and other functionalities to reduce the complexity and costs of development and operations.
grade: stable grade: stable
confinement: classic confinement: strict
apps: apps:
tdengine: tdengine:
@ -24,7 +24,9 @@ apps:
command: taoswrapper.sh command: taoswrapper.sh
plugs: plugs:
- network - network
- system-observe
- systemfiles - systemfiles
- historyfile
taosdemo: taosdemo:
command: usr/bin/taosdemo command: usr/bin/taosdemo
@ -32,11 +34,19 @@ apps:
- network - network
plugs: plugs:
historyfile:
interface: personal-files
read:
- $HOME/.taos_history
write:
- $HOME/.taos_history
systemfiles: systemfiles:
interface: system-files interface: system-files
read: read:
- /etc/taos - /etc/taos
- /var/lib/taos - /var/lib/taos
- /var/log/taos
- /tmp - /tmp
write: write:
- /var/log/taos - /var/log/taos
@ -77,7 +87,7 @@ parts:
mkdir -p $SNAPCRAFT_STAGE/var/lib/taos mkdir -p $SNAPCRAFT_STAGE/var/lib/taos
fi fi
if [ ! -d $SNAPCRAFT_STAGE/var/log/taos ]; then if [ ! -d $SNAPCRAFT_STAGE/var/log/taos ]; then
mkdir -p $SNAPCRAFT_STAGE/var/log/taos mkdir -p --mode=777 $SNAPCRAFT_STAGE/var/log/taos
fi fi
prime: prime:
@ -85,16 +95,16 @@ parts:
- usr/bin/taosd - usr/bin/taosd
- usr/bin/taos - usr/bin/taos
- usr/bin/taosdemo - usr/bin/taosdemo
- usr/lib/libtaos.so.2.0.0.6 - usr/lib/libtaos.so.2.0.2.0
- usr/lib/libtaos.so.1 - usr/lib/libtaos.so.1
- usr/lib/libtaos.so - usr/lib/libtaos.so
override-prime: | override-prime: |
snapcraftctl prime snapcraftctl prime
if [ ! -d $SNAPCRAFT_STAGE/var/lib/taos ]; then if [ ! -d $SNAPCRAFT_PRIME/var/lib/taos ]; then
cp -rf $SNAPCRAFT_STAGE/var/lib/taos $SNAPCRAFT_PRIME cp -rf $SNAPCRAFT_STAGE/var/lib/taos $SNAPCRAFT_PRIME
fi fi
if [ ! -d $SNAPCRAFT_STAGE/var/log/taos ]; then if [ ! -d $SNAPCRAFT_PRIME/var/log/taos ]; then
cp -rf $SNAPCRAFT_STAGE/var/log/taos $SNAPCRAFT_PRIME cp -rf $SNAPCRAFT_STAGE/var/log/taos $SNAPCRAFT_PRIME
fi fi
@ -103,11 +113,10 @@ layout:
bind: $SNAP_DATA/var/lib/taos bind: $SNAP_DATA/var/lib/taos
/var/log/taos: /var/log/taos:
bind: $SNAP_DATA/var/log/taos bind: $SNAP_DATA/var/log/taos
/etc/taos/taos.cfg: /etc/taos:
bind-file: $SNAP_DATA/etc/taos/taos.cfg bind: $SNAP_DATA/etc/taos
hooks: hooks:
install: install:
plugs: [systemfiles] plugs: [systemfiles, historyfile]