Skip to content

Commit

Permalink
Use Dockerfile in travis-ci setup (opensourcepos#284)
Browse files Browse the repository at this point in the history
Set version in package.json
  • Loading branch information
jekkos committed Jan 22, 2016
1 parent 192955b commit a3d3cfa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
40 changes: 18 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
language: php
php:
- 5.5
install: npm install
before_script:
- npm update -g npm
- npm install grunt-cli
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi
# enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts
- sudo cp -f travis-ci-apache /etc/apache2/sites-available/default
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
- sudo service apache2 restart
- mysql -e "create database IF NOT EXISTS ospos;" -uroot
- mysql -e "use ospos; source database/database.sql;" -uroot
- cp application/config/database.php.tmpl application/config/database.php
script: grunt mochaWebdriver:test
sudo: required

language: node_js

node_js:
- 0.10

services:
- docker

before_install:
- docker build -t jekkos/opensourcepos .
- docker run -d -p 127.0.0.1:80:80 jekkos/opensourcepos /bin/sh -c "cd /app; npm install"
- docker ps -a
- docker run jekkos/opensourcepos /bin/sh -c "cd /app; npm mochaWebdriver:test"

script:
- npm mochaWebdriver:test
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ FROM ubuntu:trusty
MAINTAINER jekkos
RUN apt-get update
RUN apt-get -y upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql php5-gd
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql php5-gd nodejs npm
RUN easy_install supervisor
ADD ./docker/foreground.sh /etc/apache2/foreground.sh
ADD ./docker/supervisord.conf /etc/supervisord.conf
RUN chmod 755 /etc/apache2/foreground.sh
# Install dependencies
RUN apt-get install -y --no-install-recommends software-properties-common
RUN apt-get install -y python git
# RUN add-apt-repository ppa:chris-lea/node.js
# RUN apt-get update && apt-get dist-upgrade

# Get latest Ospos source from Git
RUN git clone https://github.com/jekkos/opensourcepos.git /app
# RUN cd app && git checkout develop/2.4
# RUN cd app && npm install
RUN cd app && npm install

RUN ln -fs /app/* /var/www/html
ADD ./docker/start_container.sh /start_container.sh
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensourcepos",
"version": "2.4.0",
"version": "2.3.3",
"description": "Open Source Point of Sale is a web based point of sale system written in the PHP language. It uses MySQL as the data storage back-end and has a simple user interface.",
"main": "index.php",
"scripts": {
Expand Down

0 comments on commit a3d3cfa

Please sign in to comment.