snapcraft.yaml 2.3 KB
Newer Older
sangshuduo's avatar
sangshuduo 已提交
1
name: tdengine
2
base: core20
haoranc's avatar
haoranc 已提交
3
version: '2.4.0.18'
sangshuduo's avatar
sangshuduo 已提交
4
icon: snap/gui/t-dengine.svg
5
summary: an open-source big data platform designed and optimized for IoT. 
sangshuduo's avatar
sangshuduo 已提交
6 7 8 9
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.

grade: stable
sangshuduo's avatar
sangshuduo 已提交
10
confinement: strict
sangshuduo's avatar
sangshuduo 已提交
11 12 13 14 15 16 17 18 19

apps:
  tdengine:
    command: launcher.sh
    daemon: simple
    restart-condition: always
    plugs:
      - network
      - network-bind
20
      - system-observe
sangshuduo's avatar
sangshuduo 已提交
21 22

  taos:
23
    command: taoswrapper.sh
sangshuduo's avatar
sangshuduo 已提交
24 25
    plugs:
      - network
sangshuduo's avatar
sangshuduo 已提交
26
      - system-observe
sangshuduo's avatar
sangshuduo 已提交
27 28 29 30 31 32 33

parts:
  script:
    plugin: dump
    source: snap/local/
    prime:
      - launcher.sh
34
      - taoswrapper.sh
sangshuduo's avatar
sangshuduo 已提交
35 36

  tdengine:
37
    plugin: cmake
sangshuduo's avatar
sangshuduo 已提交
38 39 40 41 42 43 44
    source: .
    source-type: local
    build-packages:
      - gcc
      - g++
      - make
      - cmake
45 46 47
    cmake-parameters:
      - -DCMAKE_BUILD_TYPE=Release
      - -DBUILD_HTTP=true
sangshuduo's avatar
sangshuduo 已提交
48 49 50 51 52
    override-build: |
      snapcraftctl build
      if [ ! -d $SNAPCRAFT_STAGE/usr ]; then
        mkdir $SNAPCRAFT_STAGE/usr
      fi
53

sangshuduo's avatar
sangshuduo 已提交
54 55 56
      if [ ! -d $SNAPCRAFT_STAGE/etc/taos ]; then
        mkdir -p $SNAPCRAFT_STAGE/etc/taos
      fi
57

sangshuduo's avatar
sangshuduo 已提交
58 59 60
      cp $SNAPCRAFT_PART_BUILD/build/* -rf $SNAPCRAFT_STAGE/usr/
      cp $SNAPCRAFT_PART_SRC/packaging/cfg/taos.cfg -rf $SNAPCRAFT_STAGE/etc/taos/

61 62 63 64
      if [ ! -d $SNAPCRAFT_STAGE/var/lib/taos ]; then
        mkdir -p $SNAPCRAFT_STAGE/var/lib/taos
      fi
      if [ ! -d $SNAPCRAFT_STAGE/var/log/taos ]; then
sangshuduo's avatar
sangshuduo 已提交
65
        mkdir -p --mode=777 $SNAPCRAFT_STAGE/var/log/taos
66 67
      fi

sangshuduo's avatar
sangshuduo 已提交
68 69 70 71
    prime:
      - etc/taos/taos.cfg
      - usr/bin/taosd
      - usr/bin/taos
72
      - usr/lib/libtaos.so.2.4.0.5
sangshuduo's avatar
sangshuduo 已提交
73 74 75
      - usr/lib/libtaos.so.1
      - usr/lib/libtaos.so

76 77
    override-prime: |
      snapcraftctl prime
sangshuduo's avatar
sangshuduo 已提交
78
      if [ ! -d $SNAPCRAFT_PRIME/var/lib/taos ]; then
79 80
        cp -rf $SNAPCRAFT_STAGE/var/lib/taos $SNAPCRAFT_PRIME
      fi
sangshuduo's avatar
sangshuduo 已提交
81
      if [ ! -d $SNAPCRAFT_PRIME/var/log/taos ]; then
82 83 84 85 86 87 88 89
        cp -rf  $SNAPCRAFT_STAGE/var/log/taos $SNAPCRAFT_PRIME
      fi

layout:
  /var/lib/taos:
    bind: $SNAP_DATA/var/lib/taos
  /var/log/taos:
    bind: $SNAP_DATA/var/log/taos
sangshuduo's avatar
sangshuduo 已提交
90 91
  /etc/taos:
    bind: $SNAP_DATA/etc/taos