-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
ci: test monolithic scripts (#179)
* ci: test monolithic scripts * fix spawn * sleep between backup and restore to allow container to come up
1 parent
f6665cb
commit a57c11b
Showing
4 changed files
with
119 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,9 +26,32 @@ jobs: | |
-w "/v" \ | ||
koalaman/shellcheck \ | ||
-e SC1091 -e SC1117 \ | ||
setup.sh | ||
*.sh | ||
- name: docker compose config test | ||
run: | | ||
echo "" > .env | ||
docker compose config | ||
- name: install supportpal | ||
run: | | ||
bash setup.sh --local -n --host "http://localhost" --email "[email protected]" | ||
docker compose up -d | ||
sudo apt install -y expect | ||
expect verify-install.exp | ||
sleep 5 | ||
curl -fSL -o /tmp/test.txt http://localhost/ | ||
if ! grep -q "SupportPal" /tmp/test.txt; then | ||
echo "ERROR: SupportPal is not loading via HTTP" | ||
exit 3 | ||
fi | ||
env: | ||
SUPPORTPAL_LICENSE_KEY: "${{ secrets.SUPPORTPAL_MONO_LICENSE_KEY }}" | ||
|
||
- name: test backup/restore | ||
run: | | ||
bash backup.sh | ||
sleep 60 | ||
bash restore.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/usr/bin/expect -f | ||
# | ||
# This Expect script was generated by autoexpect on Mon Feb 5 13:07:01 2024 | ||
# Expect and autoexpect were both written by Don Libes, NIST. | ||
# | ||
# Note that autoexpect does not guarantee a working script. It | ||
# necessarily has to guess about certain things. Two reasons a script | ||
# might fail are: | ||
# | ||
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet, | ||
# etc.) and devices discard or ignore keystrokes that arrive "too | ||
# quickly" after prompts. If you find your new script hanging up at | ||
# one spot, try adding a short sleep just before the previous send. | ||
# Setting "force_conservative" to 1 (see below) makes Expect do this | ||
# automatically - pausing briefly before sending each character. This | ||
# pacifies every program I know of. The -c flag makes the script do | ||
# this in the first place. The -C flag allows you to define a | ||
# character to toggle this mode off and on. | ||
|
||
set force_conservative 0 ;# set to 1 to force conservative mode even if | ||
;# script wasn't run conservatively originally | ||
if {$force_conservative} { | ||
set send_slow {1 .1} | ||
proc send {ignore arg} { | ||
sleep .1 | ||
exp_send -s -- $arg | ||
} | ||
} | ||
|
||
# | ||
# 2) differing output - Some programs produce different output each time | ||
# they run. The "date" command is an obvious example. Another is | ||
# ftp, if it produces throughput statistics at the end of a file | ||
# transfer. If this causes a problem, delete these patterns or replace | ||
# them with wildcards. An alternative is to use the -p flag (for | ||
# "prompt") which makes Expect only look for the last line of output | ||
# (i.e., the prompt). The -P flag allows you to define a character to | ||
# toggle this mode off and on. | ||
# | ||
# Read the man page for more info. | ||
# | ||
# -Don | ||
|
||
|
||
set timeout -1 | ||
|
||
match_max 100000 | ||
|
||
spawn docker compose exec supportpal bash -c {bash /init/init-helpdesk.sh} | ||
|
||
expect "I Accept and Continue (yes/no)*:\r" | ||
send -- "yes\r" | ||
|
||
expect "SupportPal requires a valid license to function, please enter one below.*:*" | ||
sleep 1 | ||
send "$env(SUPPORTPAL_LICENSE_KEY)\r" | ||
|
||
expect "Email*:*" | ||
send -- "[email protected]\r" | ||
|
||
expect "Password*:*" | ||
send -- "test\r" | ||
|
||
expect "First Name*:*" | ||
send -- "Joe\r" | ||
|
||
expect "Last Name*:*" | ||
send -- "Blogs\r" | ||
|
||
expect "Brand Name*:*" | ||
send -- "My Company\r" | ||
|
||
expect "Enter the full web address of your installation*:*" | ||
send -- "http://localhost\r" | ||
|
||
expect "Enter your main company email address*:*" | ||
send -- "[email protected]\r" | ||
|
||
expect eof |