From c5cd1fbe80ce8fb8415651a362d7bae247416a28 Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sat, 23 May 2020 20:59:18 +0700 Subject: [PATCH 1/9] Test stages & phases --- .travis.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2973be3..93cb36a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,51 @@ -dist: trusty -before_install: -- sudo apt-get update -qq -- sudo apt-get install -qq perl shellcheck devscripts -script: prove +env: + - OS_IMAGE=centos:6 VMIN_BUNDLE=LAMP VMIN_MODE= + - OS_IMAGE=centos:6 VMIN_BUNDLE=LAMP VMIN_MODE=--minimal + - OS_IMAGE=centos:6 VMIN_BUNDLE=LEMP VMIN_MODE= + - OS_IMAGE=centos:6 VMIN_BUNDLE=LEMP VMIN_MODE=--minimal + - OS_IMAGE=centos:7 VMIN_BUNDLE=LAMP VMIN_MODE= + - OS_IMAGE=centos:7 VMIN_BUNDLE=LAMP VMIN_MODE=--minimal + - OS_IMAGE=centos:7 VMIN_BUNDLE=LEMP VMIN_MODE= + - OS_IMAGE=centos:7 VMIN_BUNDLE=LEMP VMIN_MODE=--minimal + - OS_IMAGE=ubuntu:16.04 VMIN_BUNDLE=LAMP VMIN_MODE= + - OS_IMAGE=ubuntu:16.04 VMIN_BUNDLE=LAMP VMIN_MODE=--minimal + - OS_IMAGE=ubuntu:16.04 VMIN_BUNDLE=LEMP VMIN_MODE= + - OS_IMAGE=ubuntu:16.04 VMIN_BUNDLE=LEMP VMIN_MODE=--minimal + - OS_IMAGE=ubuntu:18.04 VMIN_BUNDLE=LAMP VMIN_MODE= + - OS_IMAGE=ubuntu:18.04 VMIN_BUNDLE=LAMP VMIN_MODE=--minimal + - OS_IMAGE=ubuntu:18.04 VMIN_BUNDLE=LEMP VMIN_MODE= + - OS_IMAGE=ubuntu:18.04 VMIN_BUNDLE=LEMP VMIN_MODE=--minimal + - OS_IMAGE=debian:9 VMIN_BUNDLE=LAMP VMIN_MODE= + - OS_IMAGE=debian:9 VMIN_BUNDLE=LAMP VMIN_MODE=--minimal + - OS_IMAGE=debian:9 VMIN_BUNDLE=LEMP VMIN_MODE= + - OS_IMAGE=debian:9 VMIN_BUNDLE=LEMP VMIN_MODE=--minimal + - OS_IMAGE=debian:10 VMIN_BUNDLE=LAMP VMIN_MODE= + - OS_IMAGE=debian:10 VMIN_BUNDLE=LAMP VMIN_MODE=--minimal + - OS_IMAGE=debian:10 VMIN_BUNDLE=LEMP VMIN_MODE= + - OS_IMAGE=debian:10 VMIN_BUNDLE=LEMP VMIN_MODE=--minimal + +stages: + - syntaxValidation + - installerValidation + +services: + - docker + +jobs: + include: + - stage: syntaxValidation + name: Validate bash file syntax + dist: trusty + before_install: + - sudo apt-get update -qq + - sudo apt-get install -qq perl shellcheck devscripts + env: OS_IMAGE=ubuntu:18.04 + script: prove + + - stage: installerValidation + name: Verify that installer run success on all grade A OSes + before_install: + - docker pull $OS_IMAGE + script: + - docker run -t --rm -v $(pwd):/src -w /src $OS_IMAGE ./virtualmin-install.sh -f -b $VMIN_BUNDLE $VMIN_MODE + From a655a2d5ac51239983e0294a0ad30e2c01fd3e5a Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sat, 23 May 2020 21:05:55 +0700 Subject: [PATCH 2/9] Make the file be executable --- virtualmin-install.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 virtualmin-install.sh diff --git a/virtualmin-install.sh b/virtualmin-install.sh old mode 100644 new mode 100755 From 56968d05f09141d9a234920630cc2c913f30fcbc Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sat, 23 May 2020 21:10:33 +0700 Subject: [PATCH 3/9] Add host name & rename the stage to test to have the matrix expansion --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 93cb36a..592f125 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ env: stages: - syntaxValidation - - installerValidation + - test services: - docker @@ -42,10 +42,10 @@ jobs: env: OS_IMAGE=ubuntu:18.04 script: prove - - stage: installerValidation + - stage: test name: Verify that installer run success on all grade A OSes before_install: - docker pull $OS_IMAGE script: - - docker run -t --rm -v $(pwd):/src -w /src $OS_IMAGE ./virtualmin-install.sh -f -b $VMIN_BUNDLE $VMIN_MODE + - docker run -h test.virtualmin.com -t --rm -v $(pwd):/src -w /src $OS_IMAGE ./virtualmin-install.sh -f -b $VMIN_BUNDLE $VMIN_MODE From c1b54bf57492c6136251706d378aed38a3dcbd05 Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sat, 23 May 2020 21:14:41 +0700 Subject: [PATCH 4/9] Move all scripts out --- .travis.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 592f125..0a727fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,11 @@ stages: services: - docker +before_install: + - docker pull $OS_IMAGE +script: + - docker run -h test.virtualmin.com -t --rm -v $(pwd):/src -w /src $OS_IMAGE ./virtualmin-install.sh -f -b $VMIN_BUNDLE $VMIN_MODE + jobs: include: - stage: syntaxValidation @@ -41,11 +46,3 @@ jobs: - sudo apt-get install -qq perl shellcheck devscripts env: OS_IMAGE=ubuntu:18.04 script: prove - - - stage: test - name: Verify that installer run success on all grade A OSes - before_install: - - docker pull $OS_IMAGE - script: - - docker run -h test.virtualmin.com -t --rm -v $(pwd):/src -w /src $OS_IMAGE ./virtualmin-install.sh -f -b $VMIN_BUNDLE $VMIN_MODE - From 4ce7d34fba2cbd7f88d5284af163af3433f9f1f6 Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sat, 23 May 2020 21:21:10 +0700 Subject: [PATCH 5/9] Add language description --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 0a727fb..0b3c67f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +language: perl + env: - OS_IMAGE=centos:6 VMIN_BUNDLE=LAMP VMIN_MODE= - OS_IMAGE=centos:6 VMIN_BUNDLE=LAMP VMIN_MODE=--minimal From 66542c1ca75a8c44bccc9821eaf4641907b0d127 Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sat, 23 May 2020 21:22:01 +0700 Subject: [PATCH 6/9] Use trusty distro for the whole build --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0b3c67f..042f1de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: perl +dist: trusty + env: - OS_IMAGE=centos:6 VMIN_BUNDLE=LAMP VMIN_MODE= - OS_IMAGE=centos:6 VMIN_BUNDLE=LAMP VMIN_MODE=--minimal @@ -42,7 +44,6 @@ jobs: include: - stage: syntaxValidation name: Validate bash file syntax - dist: trusty before_install: - sudo apt-get update -qq - sudo apt-get install -qq perl shellcheck devscripts From 15cd20e1aa9fd46a113778d2d7c3852d91cd2c9b Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sat, 23 May 2020 21:32:59 +0700 Subject: [PATCH 7/9] Remove language description, since it causes setup issue. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 042f1de..c032444 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -language: perl - dist: trusty env: From f78987401ac76832f92608efadbd1d9ef8fd88a3 Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sat, 23 May 2020 22:00:13 +0700 Subject: [PATCH 8/9] Try to fix issue: error: process ID out of range --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c032444..ca922e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ services: before_install: - docker pull $OS_IMAGE script: - - docker run -h test.virtualmin.com -t --rm -v $(pwd):/src -w /src $OS_IMAGE ./virtualmin-install.sh -f -b $VMIN_BUNDLE $VMIN_MODE + - docker run -h test.virtualmin.com -t --rm -v $(pwd):/src -w /src $OS_IMAGE /bin/sh -c "./virtualmin-install.sh -f -b $VMIN_BUNDLE $VMIN_MODE" jobs: include: From f60798bb8ad1a2c3c6041f03d1e807b483d49eb4 Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sat, 23 May 2020 22:07:02 +0700 Subject: [PATCH 9/9] Print installation log --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ca922e6..fee75e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,8 +35,13 @@ services: before_install: - docker pull $OS_IMAGE + - touch $(pwd)/install.log + script: - - docker run -h test.virtualmin.com -t --rm -v $(pwd):/src -w /src $OS_IMAGE /bin/sh -c "./virtualmin-install.sh -f -b $VMIN_BUNDLE $VMIN_MODE" + - docker run -h test.virtualmin.com -t --rm -v $(pwd):/src -v $(pwd)/install.log:/root/virtualmin-install.log -w /src $OS_IMAGE /bin/sh -c "./virtualmin-install.sh -f -b $VMIN_BUNDLE $VMIN_MODE" + +after_script: + - cat $(pwd)/install.log jobs: include: