Copy the repo before running any tests.
This commit is contained in:
parent
cafda2a116
commit
edae9ebd0e
|
@ -3,4 +3,4 @@ variables:
|
|||
|
||||
test:
|
||||
script:
|
||||
- docker run --rm -h pandorafms -t -v "$CI_PROJECT_DIR:/tmp/pandorafms" pandorafms/pandorafms-base /tmp/pandorafms/tests/test.sh
|
||||
- docker run --rm -h pandorafms -t -v "$CI_PROJECT_DIR:$CI_PROJECT_DIR" -e CI_PROJECT_DIR="$CI_PROJECT_DIR" pandorafms/pandorafms-base /tmp/pandorafms/tests/test.sh
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
#!/bin/bash
|
||||
SOURCE_DIR="/tmp/pandorafms"
|
||||
|
||||
# Work on a clean directory when using GitLab CI.
|
||||
if [ "$CI_PROJECT_DIR" != "" ]; then
|
||||
cp -r "$CI_PROJECT_DIR" "$SOURCE_DIR"
|
||||
fi
|
||||
|
||||
################################################
|
||||
# Check the exit status of the last run command.
|
||||
# Exits if it different from 0.
|
||||
|
@ -23,24 +28,24 @@ service httpd start
|
|||
check "Starting the Apache Web Server" $?
|
||||
|
||||
# Install the Pandora FMS Console.
|
||||
cd /tmp/pandorafms/pandora_console && chmod +x pandora_console_install && yes | ./pandora_console_install --install
|
||||
cd $SOURCE_DIR/pandora_console && chmod +x pandora_console_install && yes | ./pandora_console_install --install
|
||||
check "Installing the Pandora FMS Console" $?
|
||||
|
||||
# Create the Pandora FMS database.
|
||||
cd /tmp/pandorafms/tests && chmod +x install_console.py && ./install_console.py
|
||||
cd $SOURCE_DIR/tests && chmod +x install_console.py && ./install_console.py
|
||||
check "Creating the Pandora FMS Database" $?
|
||||
|
||||
# Build and install the Pandora FMS Server.
|
||||
cd /tmp/pandorafms/pandora_server && perl Makefile.PL && make # Do not run make test now. Some tests need files created by pandora_server_installer.
|
||||
cd $SOURCE_DIR/pandora_server && perl Makefile.PL && make # Do not run make test now. Some tests need files created by pandora_server_installer.
|
||||
check "Building the Pandora FMS Server" $?
|
||||
cd /tmp/pandorafms/pandora_server && chmod +x pandora_server_installer && ./pandora_server_installer --install
|
||||
cd $SOURCE_DIR/pandora_server && chmod +x pandora_server_installer && ./pandora_server_installer --install
|
||||
check "Installing the Pandora FMS Server" $?
|
||||
sed -i -e 's/^dbuser.*/dbuser root/' /etc/pandora/pandora_server.conf
|
||||
cd /tmp/pandorafms/pandora_server && make test
|
||||
cd $SOURCE_DIR/pandora_server && make test
|
||||
check "Running tests for the Pandora FMS Server" $?
|
||||
|
||||
# Install the Pandora FMS Agent.
|
||||
cd /tmp/pandorafms/pandora_agents/unix && chmod +x pandora_agent_installer && ./pandora_agent_installer --install
|
||||
cd $SOURCE_DIR/pandora_agents/unix && chmod +x pandora_agent_installer && ./pandora_agent_installer --install
|
||||
check "Installing the Pandora FMS Agent" $?
|
||||
|
||||
# Start Pandora FMS services.
|
||||
|
|
Loading…
Reference in New Issue