Skip to content

Commit

Permalink
build: Switch to iotjs runtime by default
Browse files Browse the repository at this point in the history
Change-Id: Id6ff648277dfcc815f81e1f670dfc830509ffde6
Signed-off-by: Philippe Coval <p.coval@samsung.com>
  • Loading branch information
rzr committed Feb 27, 2019
1 parent 96d0ce4 commit ebf1062
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
47 changes: 38 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#}

FROM node:latest
FROM ubuntu:18.04
MAINTAINER Philippe Coval (p.coval@samsung.com)

ENV DEBIAN_FRONTEND noninteractive
Expand All @@ -36,25 +36,54 @@ ENV project mastodon-lite
RUN echo "#log: ${project}: Setup system" \
&& set -x \
&& apt-get update -y \
&& npm --version || apt-get install -y npm \
&& node --version \
&& apt-get install -y \
dpkg-dev \
git \
make \
sudo \
&& apt-get clean \
&& sync

RUN echo "#log: Install iotjs" \
&& set -x \
&& sudo apt-get update -y \
&& apt-cache show iotjs || echo "TODO: iotjs is in debian:testing !"\
&& dpkg-architecture || :\
&& . /etc/os-release \
&& distro="${ID}_${VERSION_ID}" \
&& [ "debian" != "${ID}" ] || distro="${distro}.0" \
&& distro=$(echo "${distro}" | sed 's/.*/\u&/') \
&& [ "ubuntu" != "${ID}" ] || distro="x${distro}" \
&& url="http://download.opensuse.org/repositories/home:/rzrfreefr:/snapshot/$distro" \
&& file="/etc/apt/sources.list.d/org_opensuse_home_rzrfreefr_snapshot.list" \
&& echo "deb [allow-insecure=yes] $url /" | sudo tee "$file" \
&& sudo apt-get update -y \
&& apt-cache search --full iotjs \
&& version=$(apt-cache show "iotjs-snapshot" \
| grep 'Version:' | cut -d' ' -f2 | sort -n | head -n1 || echo 0) \
&& sudo apt-get install -y --allow-unauthenticated \
iotjs-snapshot="$version" iotjs="$version" \
&& which iotjs \
&& iotjs -h || echo "log: iotjs's usage expected to be printed before" \
&& sync

ENV project generic-sensor-lite
ADD . /usr/local/${project}/${project}
WORKDIR /usr/local/${project}/${project}
RUN echo "#log: ${project}: Preparing sources" \
&& set -x \
&& npm install \
|| cat npm-debug.log \
&& npm install \
&& make setup \
&& sync

WORKDIR /usr/local/${project}/${project}
RUN echo "#log: ${project}: Preparing sources" \
RUN echo "#log: ${project}: Testing sources" \
&& set -x \
&& ls .mastodon-lite.json || echo "ERROR: please config file" \
&& ls .mastodon-lite.json && echo "WARNING: Don't publish image" \
&& cp -v .mastodon-lite.json ${HOME} || echo "Using default config" \
&& set -x \
&& npm test \
&& make test \
&& sync

WORKDIR /usr/local/${project}/${project}
ENTRYPOINT [ "/usr/bin/env", "make" ]
CMD [ "test" ]
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
version: "2"

services:
web:
default:
build: .
command: /usr/local/mastodon-lite/mastodon-lite/run.sh
command: test
volumes:
- /usr/local/mastodon-lite/mastodon-lite/

0 comments on commit ebf1062

Please sign in to comment.