mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-17 10:10:25 +00:00
Use a specific script to run the bootstrap tests.
Additionally test git installs using a specific tag and sha commit.
This commit is contained in:
parent
68726344a9
commit
421fe1b843
2 changed files with 79 additions and 7 deletions
78
.run-boostrap-tests.sh
Executable file
78
.run-boostrap-tests.sh
Executable file
|
@ -0,0 +1,78 @@
|
|||
#!/bin/bash -
|
||||
#===============================================================================
|
||||
#
|
||||
# FILE: .travis-ci-test.sh
|
||||
#
|
||||
# USAGE: ./.travis-ci-test.sh
|
||||
#
|
||||
# DESCRIPTION:
|
||||
#
|
||||
# OPTIONS: ---
|
||||
# REQUIREMENTS: ---
|
||||
# BUGS: ---
|
||||
# NOTES: ---
|
||||
# AUTHOR: Pedro Algarvio (s0undt3ch), pedro@algarvio.me
|
||||
# ORGANIZATION: UfSoft.org
|
||||
# CREATED: 01/23/2013 06:01:27 PM WET
|
||||
# REVISION: ---
|
||||
#===============================================================================
|
||||
|
||||
set -o nounset # Treat unset variables as an error
|
||||
|
||||
COLUMNS=$(tput cols) || 80
|
||||
|
||||
title_echo() {
|
||||
title="$1"
|
||||
line="$(printf "%${COLUMNS}s" "")"
|
||||
printf "\033[1;34m%s\033[0m\n" "${line// /*}"
|
||||
printf "\033[1;34m%*s\033[0m\n" $(((${#title}+$COLUMNS)/2)) "$title"
|
||||
# printf "\033[1;34m%s\033[0m\n" "${line// /*}"
|
||||
}
|
||||
|
||||
failed_echo() {
|
||||
title="FAILED"
|
||||
line="$(printf "%${COLUMNS}s" "")"
|
||||
# printf "\031[1;34m%s\033[0m\n" "${line// /*}"
|
||||
printf "\031[1;34m%*s\033[0m\n" $(((${#title}+$COLUMNS)/2)) "$title"
|
||||
printf "\031[1;34m%s\033[0m\n" "${line// /*}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
passed_echo() {
|
||||
title="OK"
|
||||
line="$(printf "%${COLUMNS}s" "")"
|
||||
# printf "\033[1;32m%s\033[0m\n" "${line// /*}"
|
||||
printf "\033[1;32m%*s\033[0m\n" $(((${#title}+$COLUMNS)/2)) "$title"
|
||||
printf "\033[1;32m%s\033[0m\n" "${line// /*}"
|
||||
}
|
||||
|
||||
title_echo "Running checkbashisms"
|
||||
/usr/bin/checkbashisms -pxfn bootstrap-salt-minion.sh && passed_echo || failed_echo
|
||||
|
||||
title_echo "Installing using bash"
|
||||
(sudo /bin/bash bootstrap-salt-minion.sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
|
||||
|
||||
title_echo "Installing using sh"
|
||||
(sudo ./bootstrap-salt-minion.sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
|
||||
|
||||
title_echo "Installing stable with sh"
|
||||
(sudo ./bootstrap-salt-minion.sh stable && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
|
||||
|
||||
title_echo "Installing ubuntu daily packages using sh"
|
||||
(sudo ./bootstrap-salt-minion.sh daily && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
|
||||
|
||||
title_echo "Using an unknown installation type fails"
|
||||
sudo ./bootstrap-salt-minion.sh foobar && failed_echo || passed_echo
|
||||
|
||||
title_echo "Installing stable piped through sh"
|
||||
(cat ./bootstrap-salt-minion.sh | sudo sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo
|
||||
|
||||
title_echo "Installing latest develop branch from git"
|
||||
(sudo ./bootstrap-salt-minion.sh git develop && salt --versions-report && sudo rm -rf /tmp/git ) && passed_echo || failed_echo
|
||||
|
||||
title_echo "Installing from a specific git tag"
|
||||
(sudo ./bootstrap-salt-minion.sh git v0.12.1 && salt --versions-report && sudo rm -rf /tmp/git ) && passed_echo || failed_echo
|
||||
|
||||
title_echo "Installing from a specific git sha commit"
|
||||
(sudo ./bootstrap-salt-minion.sh git bf1d7dfb733a6133d6a750e0ab63a27e72cf7e81 && salt --versions-report && sudo rm -rf /tmp/git ) && passed_echo || failed_echo
|
||||
|
|
@ -2,13 +2,7 @@ before_install:
|
|||
- sudo apt-get update && sudo apt-get install devscripts
|
||||
|
||||
script:
|
||||
- /usr/bin/checkbashisms -pxfn bootstrap-salt-minion.sh || exit 1
|
||||
- (/bin/echo -e '\nInstalling stable with bash' && sudo /bin/bash bootstrap-salt-minion.sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
|
||||
- (/bin/echo -e '\nInstalling stable with sh' && sudo ./bootstrap-salt-minion.sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
|
||||
- (/bin/echo -e '\nInstalling explicit stable with sh' && sudo ./bootstrap-salt-minion.sh stable && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
|
||||
- (/bin/echo -e '\nInstalling ubuntu daily with sh' && sudo ./bootstrap-salt-minion.sh daily && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
|
||||
- (/bin/echo -e '\nInstalling stable piped trough sh' && cat ./bootstrap-salt-minion.sh | sudo sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) || exit 1
|
||||
- (/bin/echo -e '\nInstalling from GIT' && sudo ./bootstrap-salt-minion.sh git develop && salt --versions-report) || exit 1
|
||||
- ./.run-boostrap-tests.sh
|
||||
|
||||
notifications:
|
||||
irc:
|
||||
|
|
Loading…
Add table
Reference in a new issue