aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMhd Sulhan <ms@kilabit.info>2015-11-21 13:24:25 +0700
committerMhd Sulhan <ms@kilabit.info>2015-11-21 13:24:25 +0700
commitb58ee96acfc595e1e1c4fa10c2b615bed1022b1f (patch)
treeec8949783df5b1e23a85e339a7de8b3af1ffef2b
parentec3b2711318526c5a23187bc6491a527e7520a2d (diff)
downloadarch-docker-b58ee96acfc595e1e1c4fa10c2b615bed1022b1f.tar.xz
Add build script for gulp et.al.
Installed npm packages alongside gulp are grunt-cli, node-gyp, jshint, pm2, phantomjs, and coffee-script.
-rwxr-xr-xarch-base-gulp-etal/bootstrap_gulp_etal.sh15
l---------arch-base-gulp-etal/clean.sh1
l---------arch-base-gulp-etal/create_image.sh1
l---------arch-base-gulp-etal/create_rootfs.sh1
-rwxr-xr-xarch-base-gulp-etal/init.sh12
-rwxr-xr-xarch-base-gulp-etal/run.sh6
-rwxr-xr-xarch-base-gulp-etal/vars.sh19
7 files changed, 55 insertions, 0 deletions
diff --git a/arch-base-gulp-etal/bootstrap_gulp_etal.sh b/arch-base-gulp-etal/bootstrap_gulp_etal.sh
new file mode 100755
index 0000000..e440fa1
--- /dev/null
+++ b/arch-base-gulp-etal/bootstrap_gulp_etal.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+echo "==> bootstraping gulp ..."
+
+npm install -g grunt-cli --unsafe-perm && \
+ npm install -g node-gyp --unsafe-perm && \
+ npm install -g gulp && \
+ npm install -g jshint && \
+ npm install -g pm2 && \
+ npm install -g phantomjs && \
+ npm install -g coffee-script && \
+ rm -r /root/.node-gyp
+
+## cleaning ...
+bootstrap_clean_nodejs
diff --git a/arch-base-gulp-etal/clean.sh b/arch-base-gulp-etal/clean.sh
new file mode 120000
index 0000000..1e93f10
--- /dev/null
+++ b/arch-base-gulp-etal/clean.sh
@@ -0,0 +1 @@
+../scripts/clean.sh \ No newline at end of file
diff --git a/arch-base-gulp-etal/create_image.sh b/arch-base-gulp-etal/create_image.sh
new file mode 120000
index 0000000..ec69652
--- /dev/null
+++ b/arch-base-gulp-etal/create_image.sh
@@ -0,0 +1 @@
+../scripts/create_image.sh \ No newline at end of file
diff --git a/arch-base-gulp-etal/create_rootfs.sh b/arch-base-gulp-etal/create_rootfs.sh
new file mode 120000
index 0000000..54a9807
--- /dev/null
+++ b/arch-base-gulp-etal/create_rootfs.sh
@@ -0,0 +1 @@
+../scripts/create_rootfs.sh \ No newline at end of file
diff --git a/arch-base-gulp-etal/init.sh b/arch-base-gulp-etal/init.sh
new file mode 100755
index 0000000..ac9c508
--- /dev/null
+++ b/arch-base-gulp-etal/init.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+#COMMANDS="pm2 start app.js"
+WORKDIR=${WORKDIR:-"/srv/www"}
+COMMANDS=${COMMANDS:-"pm2 --no-daemon start pm2.json"}
+NODE_ENV=${NODE_ENV:-"production"}
+
+cd $WORKDIR
+
+npm install && gulp dist
+
+eval $COMMANDS
diff --git a/arch-base-gulp-etal/run.sh b/arch-base-gulp-etal/run.sh
new file mode 100755
index 0000000..ad81832
--- /dev/null
+++ b/arch-base-gulp-etal/run.sh
@@ -0,0 +1,6 @@
+#!/bin/zsh
+
+docker run --env-file=env --net=host --rm \
+ -v $PWD/npm:/root/.npm \
+ -v $PWD/src:/srv/www \
+ -it sulhan/arch-gulp-etal
diff --git a/arch-base-gulp-etal/vars.sh b/arch-base-gulp-etal/vars.sh
new file mode 100755
index 0000000..88aff0c
--- /dev/null
+++ b/arch-base-gulp-etal/vars.sh
@@ -0,0 +1,19 @@
+#!/bin/zsh
+
+THISD=${0:a:h}
+
+ROOTFS_SIZE=900M
+
+PKGS+=(util-linux)
+PKGS_ADD+=(git gcc make python2 nodejs npm)
+PKGS_REMOVED=()
+
+IMAGE_NAME="sulhan/arch-gulp-etal"
+IMAGE_ARGS=(-c="VOLUME /srv/www" -c="VOLUME /root/.npm" -c="EXPOSE 10000" -c="CMD /init.sh")
+IMAGE_FILES_BAK+=("${ROOTFS}/root/.npm" "${THISD}/npm")
+
+FILES+=("${THISD}/init.sh" "${ROOTFS}/")
+FILES+=("${THISD}/bootstrap_gulp_etal.sh" "${ROOTFS}/")
+FILES+=("${THISD}/npm" "${ROOTFS}/root/.npm")
+
+BOOTSTRAP_S+=("/bootstrap_gulp_etal.sh")