Skip to content

Commit

Permalink
Merge pull request #702 from boxbilling/travis-stages
Browse files Browse the repository at this point in the history
Travis job with tests
  • Loading branch information
fordnox committed Nov 1, 2020
2 parents 0d428db + 1fe90f8 commit 593e22e
Show file tree
Hide file tree
Showing 13 changed files with 2,446 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
- name: Configure environment for Tests
run: |
cp ./src/bb-config-sample.php ./src/bb-config.php
mkdir ./src/bb-data/cache
mkdir ./src/bb-data/log
mkdir -p ./src/bb-data/cache
mkdir -p ./src/bb-data/log
echo > ./src/bb-data/log/license.log
echo > ./src/bb-data/log/application.log
echo > ./src/bb-data/log/php_error.log
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ composer.phar
public
report/*
data/db
.phpunit.result.cache

### node_moduels ###
node_modules
Expand Down
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ before_script:
- docker version

script:
- make test
- make all

before_deploy:
- make release

deploy:
provider: releases
token: tVzZ+3U0ndBGvoUpFqA6ikg6fDKnPgMoNqK1pvTdEp0xmrFtjMP/fuc8+awObhj89iEC+MyzfsOP57CZbHR/UjmUSHPQew+BvTwxYmTUzgUeyUrYsTEI7WJgB7tsL35aRgrpxk102tlSmlX7EonufUT0svPOAQ1p4NgZRm3GI3A=
file: ./build/distribution/BoxBilling.zip
draft: true
on:
tags: true

notifications:
email: false
slack: boxbilling:vsdKszFU9Pm308ye5rNSpr8n
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Release 4.21
------------------------------------------------------------------------------
* Removed License Check

Release 4.20
------------------------------------------------------------------------------
* PHP 7.0 support
* Changed password hashing method

Release 4.19
------------------------------------------------------------------------------
* Cron job memory optimizations
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM pensiero/apache-php-mysql:php7.4
RUN apt-get install nano -y
ADD ./build/source /var/www/public
26 changes: 24 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,34 @@ exec-db: ## Enter DB container shell
$(DOCKER_DB_CONTAINER_EXEC) bash

install: start ## Install app after start
$(DOCKER_PHP_CONTAINER_EXEC) composer install --working-dir=src
$(DOCKER_PHP_CONTAINER_EXEC) composer install --working-dir=src --no-progress --no-suggest --optimize-autoloader --prefer-dist --no-dev
ifeq (,$(wildcard ./src/bb-config.php))
cp ./src/bb-config-sample.php ./src/bb-config.php
$(DOCKER_PHP_CONTAINER_EXEC) $(DOCKER_PHP_EXECUTABLE_CMD) ./bin/prepare.php
endif

reinstall: ## Reinstall app
rm -rf ./src/bb-config.php
make install
make install

test: install ## Run app tests
echo "Running unit tests"
echo > ./src/bb-data/log/application.log
echo > ./src/bb-data/log/php_error.log
$(DOCKER_PHP_CONTAINER_EXEC) composer install --working-dir=src --no-progress --no-suggest --optimize-autoloader --prefer-dist
$(DOCKER_PHP_CONTAINER_EXEC) ./src/bb-vendor/bin/phpunit --dont-report-useless-tests ./tests/bb-modules/

release: ## App release
echo $(TRAVIS_BUILD_DIR)
echo $(TRAVIS_BUILD_ID)
echo $(TRAVIS_BUILD_NUMBER)
echo $(TRAVIS_JOB_ID)
echo $(TRAVIS_TAG)
npm install -g grunt-cli
npm install
grunt
ant release

release-open:
docker run -d -p 8741:80 --mount type=bind,source="$(PWD)"/build/source,target=/var/www/public pensiero/apache-php-mysql:php7.4
open http://localhost:8741/install/
19 changes: 4 additions & 15 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@

<target name="composer" description="Update composer dependencies" depends="clean-vendors">
<exec executable="composer" failonerror="true">
<arg line="--working-dir=src install --no-dev --optimize-autoloader --prefer-dist" />
<arg line="install --working-dir=src --no-dev --optimize-autoloader --prefer-dist" />
</exec>
</target>

<target name="composer-dev" description="Update composer dependencies">
<exec executable="composer" failonerror="true">
<arg line="--working-dir=src install --optimize-autoloader --prefer-dist" />
<arg line="install --working-dir=src --optimize-autoloader --prefer-dist" />
</exec>
</target>

Expand Down Expand Up @@ -112,18 +112,7 @@
</exec>
</target>

<target name="remove-fonts" description="Remove tFPDF fonts which are not necessary">
<delete>
<fileset dir="${basedir}/src/bb-vendor/rev42/tfpdf/src/font/unifont">
<include name="*"/>
<exclude name="DejaVuSansCondensed-Bold.ttf"/>
<exclude name="DejaVuSansCondensed.ttf"/>
<exclude name="ttfonts.php"/>
</fileset>
</delete>
</target>

<target name="build-api" depends="clean, remove-fonts">
<target name="build-api" depends="clean">
<copy todir="${source}">
<fileset refid="shared-artifacts"/>
</copy>
Expand All @@ -142,7 +131,7 @@
</exec>
</target>

<target name="package" depends="remove-fonts">
<target name="package">
<zip destfile="${dist.dir}/${ant.project.name}.zip" basedir="${source}" />
</target>

Expand Down

0 comments on commit 593e22e

Please sign in to comment.