Skip to content

Commit

Permalink
Habitat plan for hubs-discord-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
gfodor committed Jan 30, 2019
1 parent 6759cd6 commit 97d3bfc
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.env
/node_modules
results/
7 changes: 7 additions & 0 deletions habitat/default.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[general]

reticulum_host = "dev.reticulum.io"
hubs_hosts = "localhost,hubs.local"
shard_id = "0"
shard_count = "0"
verbose = "false"
11 changes: 11 additions & 0 deletions habitat/hooks/init
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

exec 2>&1

# Move directories that ship in the package into place
for dir in node_modules package.json package-lock.json src
do
cp -r {{pkg.path}}/$dir {{pkg.svc_static_path}}/
done

mkdir -p {{pkg.svc_var_path}}/run
16 changes: 16 additions & 0 deletions habitat/hooks/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

exec 2>&1

set -e

export TOKEN="{{ cfg.general.token }}"
export RETICULUM_HOST="{{ cfg.general.reticulum_host }}"
export HUBS_HOSTS="{{ cfg.general.hubs_hosts }}"
export SHARD_ID="{{ cfg.general.shard_id }}"
export SHARD_COUNT="{{ cfg.general.shard_count }}"
export VERBOSE="{{ cfg.general.verbose }}"

cd {{pkg.svc_path}}

exec node {{pkg.svc_static_path}}/src/index.js
25 changes: 25 additions & 0 deletions habitat/plan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
pkg_name=hubs-discord-bot
pkg_origin=mozillareality
pkg_maintainer="Mozilla Mixed Reality <mixreality@mozilla.com>"

pkg_version="0.0.1"
pkg_license=('MPL2')
pkg_description="Discord bot for Hubs by Mozilla"
pkg_deps=(
core/node/11.2.0
)

do_build() {
npm ci
}

do_install() {
for dir in node_modules package.json package-lock.json src
do
cp -R ./$dir "$pkg_prefix"
done
}

do_strip() {
return 0;
}

0 comments on commit 97d3bfc

Please sign in to comment.