mirror of
https://github.com/cytopia/devilbox.git
synced 2025-01-30 16:13:52 +00:00
Split all into single builds
This commit is contained in:
parent
c3a38d3d5f
commit
f176f5a134
@ -24,7 +24,7 @@ DEVILBOX_PATH="${1}"
|
||||
|
||||
run() {
|
||||
_cmd="${1}"
|
||||
_debug="1"
|
||||
_debug="0"
|
||||
|
||||
_red="\033[0;31m"
|
||||
_green="\033[0;32m"
|
||||
|
100
.tests/test_single.sh
Executable file
100
.tests/test_single.sh
Executable file
@ -0,0 +1,100 @@
|
||||
#!/bin/sh -eu
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Arguments
|
||||
#
|
||||
################################################################################
|
||||
|
||||
###
|
||||
### Validate arguments
|
||||
###
|
||||
if [ "${#}" != "3" ]; then
|
||||
echo "Error: Invalid number of arguments"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "${1}" ]; then
|
||||
echo "Error: Not a directory: ${1}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
###
|
||||
### Get arguments
|
||||
###
|
||||
DEVILBOX_PATH="$( echo "${1}"| sed 's/\/*$//' )" # remove last slash(es): /
|
||||
DEVILBOX_SERVER="${2}"
|
||||
DEVILBOX_VERSION="${3}"
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Bootstrap
|
||||
#
|
||||
################################################################################
|
||||
|
||||
###
|
||||
### Source library
|
||||
###
|
||||
. "${DEVILBOX_PATH}/.tests/.lib.sh" "${DEVILBOX_PATH}"
|
||||
|
||||
###
|
||||
### Reset .env file
|
||||
###
|
||||
reset_env_file
|
||||
|
||||
###
|
||||
### Enable debug mode
|
||||
###
|
||||
set_debug_enable
|
||||
|
||||
###
|
||||
### Alter host ports
|
||||
###
|
||||
set_host_port_httpd "80"
|
||||
set_host_port_mysql "33060"
|
||||
set_host_port_pgsql "54320"
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Test
|
||||
#
|
||||
################################################################################
|
||||
|
||||
###
|
||||
### Docker default versions to use
|
||||
###
|
||||
_httpd="apache-2.2"
|
||||
_mysql="mariadb-10.2"
|
||||
_pysql="9.6"
|
||||
_php="php-fpm-7.0"
|
||||
|
||||
###
|
||||
### Set specific version
|
||||
###
|
||||
if [ "${DEVILBOX_SERVER}" = "httpd" ]; then
|
||||
_httpd="${DEVILBOX_VERSION}"
|
||||
_head="HTTPD: ${DEVILBOX_VERSION}"
|
||||
elif [ "${DEVILBOX_SERVER}" = "mysql" ]; then
|
||||
_mysql="${DEVILBOX_VERSION}"
|
||||
_head="MYSQL: ${DEVILBOX_VERSION}"
|
||||
elif [ "${DEVILBOX_SERVER}" = "pgsql" ]; then
|
||||
_pgsql="${DEVILBOX_VERSION}"
|
||||
_head="PGSQL: ${DEVILBOX_VERSION}"
|
||||
elif [ "${DEVILBOX_SERVER}" = "php" ]; then
|
||||
_php="${DEVILBOX_VERSION}"
|
||||
_head="PHP: ${DEVILBOX_VERSION}"
|
||||
fi
|
||||
|
||||
###
|
||||
### Go
|
||||
###
|
||||
devilbox_start "${_httpd}" "${_mysql}" "${_pysql}" "${_php}" "${_head}"
|
||||
debilbox_test
|
||||
devilbox_stop
|
||||
|
||||
|
||||
|
14
.travis.yml
14
.travis.yml
@ -15,10 +15,13 @@ services:
|
||||
###
|
||||
env:
|
||||
matrix:
|
||||
- SERVER=httpd
|
||||
- SERVER=mysql
|
||||
- SERVER=pgsql
|
||||
- SERVER=php
|
||||
- SERVER=httpd VERSION=apache-2.2
|
||||
- SERVER=httpd VERSION=apache-2.4
|
||||
- SERVER=httpd VERSION=nginx-stable
|
||||
- SERVER=httpd VERSION=nginx-mainline
|
||||
#- SERVER=mysql
|
||||
#- SERVER=pgsql
|
||||
#- SERVER=php
|
||||
global:
|
||||
- DEVILBOX_PHP_VERSION="$( grep -Eo 'image:.*PHP.*:.*' docker-compose.yml | sed 's/.*:.*://g' )"
|
||||
- DEVILBOX_HTTPD_VERSION="$( grep -Eo 'image:.*HTTPD.*:.*' docker-compose.yml | sed 's/.*:.*://g' )"
|
||||
@ -72,4 +75,5 @@ before_install:
|
||||
### Test
|
||||
###
|
||||
script:
|
||||
- .tests/test_${SERVER}.sh .
|
||||
#- .tests/test_${SERVER}.sh .
|
||||
- .tests/test_single.sh . ${SERVER} ${VERSION}
|
||||
|
Loading…
x
Reference in New Issue
Block a user