|
883 | 883 | # lib/scripts/test.sh
|
884 | 884 | test_prepare_working_dir() {
|
885 | 885 | if [ "${TINE20ROOT}" != "${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20" ]; then
|
886 |
| - log "test_preapre_wirking_dir is only requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20" |
| 886 | + log "test_preapre_working_dir requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20" |
887 | 887 | # This function is only intended to work with the source from gitlab...
|
888 | 888 | # intended: for the main repo => do basicly nothing. Or for customapps => clone main repo and include customapp
|
889 | 889 | # and setup vars as if we where running in the main repo.
|
|
1061 | 1061 | entry_points:
|
1062 | 1062 | # lib/entry_points/tine_as_a_service.sh
|
1063 | 1063 | tine_as_a_service:
|
1064 |
| - - |
| 1064 | + - /bin/bash |
1065 | 1065 | - -c
|
1066 | 1066 | - |
|
1067 | 1067 | # lib/scripts/cache_cleanup.sh
|
|
1942 | 1942 | # lib/scripts/test.sh
|
1943 | 1943 | test_prepare_working_dir() {
|
1944 | 1944 | if [ "${TINE20ROOT}" != "${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20" ]; then
|
1945 |
| - log "test_preapre_wirking_dir is only requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20" |
| 1945 | + log "test_preapre_working_dir requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20" |
1946 | 1946 | # This function is only intended to work with the source from gitlab...
|
1947 | 1947 | # intended: for the main repo => do basicly nothing. Or for customapps => clone main repo and include customapp
|
1948 | 1948 | # and setup vars as if we where running in the main repo.
|
|
2117 | 2117 | echo -e "\033[0;34m"$@"\033[0m"
|
2118 | 2118 | }
|
2119 | 2119 |
|
2120 |
| - echo -n 'wait for signal_files_ready ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_files_ready ]; do sleep 1; done; echo ' done' |
| 2120 | + #!/bin/bash |
| 2121 | + echo -n 'wait for signal_mount_ready ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_mount_ready ]; do sleep 1; done; echo ' done' |
2121 | 2122 |
|
2122 |
| - cp -r /usr/share/tine20/Tinebase/js/node_modules $TINE20ROOT/Tinebase/js/node_modules |
2123 |
| - cp -r /usr/share/tine20/vendor $TINE20ROOT/tine20/vendor |
2124 |
| - |
2125 |
| - # delete potentially old code, to make sure it can not be used |
2126 |
| - if test "${TINE20ROOT}" != "/usr/share/tine20"; then rm -rf /usr/share/tine20; fi |
2127 |
| - |
2128 |
| - touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_node_modules_copied |
2129 |
| - |
2130 |
| - # install php deps |
2131 |
| - cd $TINE20ROOT/tine20 |
2132 |
| - composer install --no-ansi --no-progress --no-suggest --no-scripts --ignore-platform-reqs |
2133 |
| - $TINE20ROOT/ci/scripts/install_custom_app.sh |
| 2123 | + test_prepare_working_dir |
| 2124 | + touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_files_ready |
2134 | 2125 |
|
| 2126 | + test_composer_install |
2135 | 2127 | touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_php_deps_installed
|
2136 | 2128 |
|
2137 |
| - # install js deps |
2138 |
| - npm --prefix $TINE20ROOT/tine20/Tinebase/js/ install; |
| 2129 | + test_npm_install |
2139 | 2130 | touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_js_deps_installed
|
2140 | 2131 |
|
2141 |
| - # setup configs |
2142 |
| - /usr/sbin/confd -onetime -backend env; |
| 2132 | + rm /etc/confd/conf.d/worker.inc.php.toml || true # todo: is it needed? can it be moved to test_prepare_config |
| 2133 | + test_prepare_global_configs |
2143 | 2134 |
|
2144 | 2135 | # setup database
|
2145 | 2136 | if ! tine20_await_db; then
|
|
2148 | 2139 | exit 1
|
2149 | 2140 | fi
|
2150 | 2141 |
|
2151 |
| - mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS dovecot"; |
2152 |
| - mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS postfix"; |
2153 |
| - mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE USER IF NOT EXISTS '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';"; |
2154 |
| - mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON postfix.* TO '$MYSQL_USER'@'%'"; |
2155 |
| - mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON dovecot.* TO '$MYSQL_USER'@'%'"; |
2156 |
| - mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" "dovecot" < /config/sql/dovecot_tables.sql; |
2157 |
| - mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" "postfix" < /config/sql/postfix_tables.sql; |
| 2142 | + test_prepare_mail_db |
2158 | 2143 |
|
2159 | 2144 | # setup tine enviroment
|
2160 | 2145 | touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAMESPACE}/tine20.log
|
2161 | 2146 | chown tine20:tine20 ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAMESPACE}/tine20.log
|
2162 |
| - rm /etc/supervisor.d/worker.ini || true # todo delete when merged with "speared node container" change |
2163 |
| - rm /etc/crontabs/tine20 || true |
2164 |
| - rm /etc/confd/conf.d/worker.inc.php.toml || true |
2165 | 2147 |
|
2166 | 2148 | echo -n 'wait for signal_js_deps_installed ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_js_deps_installed ]; do sleep 1; done; echo ' done'
|
2167 | 2149 |
|
|
0 commit comments