代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/zabbix 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?xml version="1.0" encoding="UTF-8"?>
<project name="Zabbix" default="build" basedir=".">
<target name="init-common">
<condition property="phpunit_filter" value=" --filter='${PHPUNIT_FILTER}'" else="">
<and>
<isset property="PHPUNIT_FILTER" />
<length string="${PHPUNIT_FILTER}" when="greater" length="0"/>
</and>
</condition>
<!-- Cleanup from the previous run -->
<delete dir="build/logs" failonerror="off"/>
<mkdir dir="build/logs"/>
<mkdir dir="runtime"/>
</target>
<target name="create-configs" depends="init-common">
<property name="url" value="${URL}"/>
<property name="screenshot_dir" value="${SCREENSHOT_DIR}"/>
<property name="screenshot_url" value="${SCREENSHOT_URL}"/>
<property name="dbtype" value="${DBTYPE}"/>
<property name="dbhost" value="${DBHOST}"/>
<property name="dbname" value="${DBNAME}"/>
<property name="dbuser" value="${DBUSER}"/>
<property name="dbpassword" value="${DBPASSWORD}"/>
<property name="phpunit_error_log" value="${PHPUNIT_ERROR_LOG}"/>
<property name="phpunit_port_prefix" value="${PHPUNIT_PORT_PREFIX}"/>
<property name="screenshot_references_dir" value="${SCREENSHOT_REFERENCES_DIR}"/>
<condition property="phpunit_driver_address" value="${PHPUNIT_DRIVER_ADDRESS}" else="localhost">
<and>
<isset property="PHPUNIT_DRIVER_ADDRESS" />
<length string="${PHPUNIT_DRIVER_ADDRESS}" when="greater" length="0"/>
</and>
</condition>
<property environment="env"/>
<!-- Create bootstrap.php -->
<copy overwrite="true" file="ui/tests/bootstrap.php.template" tofile="ui/tests/bootstrap.php"/>
<replace file="ui/tests/bootstrap.php" token="{URL}" value="${url}"/>
<replace file="ui/tests/bootstrap.php" token="{BASEDIR}" value="${basedir}"/>
<replace file="ui/tests/bootstrap.php" token="{SCREENSHOT_DIR}" value="${screenshot_dir}"/>
<replace file="ui/tests/bootstrap.php" token="{SCREENSHOT_URL}" value="${screenshot_url}"/>
<replace file="ui/tests/bootstrap.php" token="{BINARY_DIR}" value="${basedir}/sbin/"/>
<replace file="ui/tests/bootstrap.php" token="{CONFIG_SOURCE_DIR}" value="${basedir}/conf/"/>
<replace file="ui/tests/bootstrap.php" token="{CONFIG_DIR}" value="${basedir}/etc/"/>
<replace file="ui/tests/bootstrap.php" token="{COMPONENT_DIR}" value="${basedir}/runtime/"/>
<replace file="ui/tests/bootstrap.php" token="{PORT_PREFIX}" value="${phpunit_port_prefix}"/>
<replace file="ui/tests/bootstrap.php" token="{SCREENSHOT_REFERENCES_DIR}" value="${screenshot_references_dir}"/>
<replace file="ui/tests/bootstrap.php" token="{PHPUNIT_DRIVER_ADDRESS}" value="${phpunit_driver_address}"/>
<!-- Create PHP config file -->
<copy overwrite="true" file="ui/tests/templates/zabbix.conf.php" tofile="ui/conf/zabbix.conf.php"/>
<replace file="ui/conf/zabbix.conf.php" token="{DBTYPE}" value="${dbtype}"/>
<replace file="ui/conf/zabbix.conf.php" token="{DBHOST}" value="${dbhost}"/>
<replace file="ui/conf/zabbix.conf.php" token="{DBNAME}" value="${dbname}"/>
<replace file="ui/conf/zabbix.conf.php" token="{DBUSER}" value="${dbuser}"/>
<replace file="ui/conf/zabbix.conf.php" token="{DBPASSWORD}" value="${dbpassword}"/>
<replace file="ui/conf/zabbix.conf.php" token="{PHPUNIT_ERROR_LOG}" value="${phpunit_error_log}"/>
</target>
<target name="create-saml-configs">
<property name="phpunit_simplesaml_baseurl" value="${PHPUNIT_SIMPLESAML_BASEURL}"/>
<property name="phpunit_sp_entity_id" value="${PHPUNIT_SP_ENTITY_ID}"/>
<property name="url" value="${URL}"/>
<!-- SAML settings -->
<replace file="ui/tests/bootstrap.php" token="'PHPUNIT_SAML_TESTS_ENABLED', false" value="'PHPUNIT_SAML_TESTS_ENABLED', true"/>
<replace file="ui/tests/bootstrap.php" token="{PHPUNIT_IDP_ENTITY_ID}" value="${phpunit_simplesaml_baseurl}/saml2/idp/metadata.php"/>
<replace file="ui/tests/bootstrap.php" token="{PHPUNIT_SSO_SERVICE_URL}" value="${phpunit_simplesaml_baseurl}/saml2/idp/SSOService.php"/>
<replace file="ui/tests/bootstrap.php" token="{PHPUNIT_SLO_SERVICE_URL}" value="${phpunit_simplesaml_baseurl}/saml2/idp/SingleLogoutService.php"/>
<replace file="ui/tests/bootstrap.php" token="{PHPUNIT_SP_ENTITY_ID}" value="${phpunit_sp_entity_id}"/>
<!-- Download SAML X509 certificates -->
<get src="${phpunit_simplesaml_baseurl}/module.php/saml/idp/certs.php/idp.crt" dest="ui/conf/certs"/>
<copy overwrite="true" file="${SIMPLESAMLPHP_CFG_FILE}.template" tofile="${SIMPLESAMLPHP_CFG_FILE}"/>
<replace file="${SIMPLESAMLPHP_CFG_FILE}" token="{ENTITY_ID}" value="${phpunit_sp_entity_id}"/>
<replace file="${SIMPLESAMLPHP_CFG_FILE}" token="{ASSERTION_CONSUMER_SERVICE}" value="${url}index_sso.php?acs"/>
<replace file="${SIMPLESAMLPHP_CFG_FILE}" token="{SINGLE_LOGOUT_SERVICE}" value="${url}index_sso.php?sls"/>
</target>
<target name="init-integration">
<!-- Copy agent2 configuration file -->
<copy overwrite="true" file="src/go/conf/zabbix_agent2.conf" tofile="conf/zabbix_agent2.conf"/>
</target>
<target name="init-frontend-modules">
<!-- Copy modules directory for selenium tests -->
<copydir forceoverwrite="true" src="ui/tests/selenium/modules" dest="ui/modules"/>
</target>
<target name="make-dbschema">
<!-- Create database schema -->
<exec executable="./bootstrap.sh" failonerror="on"/>
<exec executable="./configure" failonerror="on">
<arg line="--quiet"/>
</exec>
<exec executable="make" failonerror="on">
<arg line="-j4"/>
<arg line="-s"/>
<arg line="dbschema"/>
</exec>
</target>
<target name="make-gettext">
<!-- Build translation strings -->
<exec executable="make" failonerror="on">
<arg line="-j4"/>
<arg line="-s"/>
<arg line="gettext"/>
</exec>
</target>
<target name="make-binaries-postgresql">
<!-- Binaries for integration tests -->
<exec executable="./bootstrap.sh" failonerror="on"/>
<exec executable="./configure" failonerror="on">
<arg line="--quiet"/>
<arg line="--enable-server"/>
<arg line="--enable-proxy"/>
<arg line="--enable-agent"/>
<arg line="--enable-agent2"/>
<arg line="--with-postgresql"/>
<arg line="--prefix=${basedir}"/>
</exec>
<exec executable="make" failonerror="on">
<arg line="-j4"/>
<arg line="-s"/>
<arg line="dbschema"/>
</exec>
<exec executable="make" failonerror="on">
<arg line="-j4"/>
<arg line="-s"/>
<arg line="install"/>
</exec>
</target>
<target name="create-db-postgresql" depends="drop-db-postgresql">
<!-- Create PostgreSQL database -->
<exec executable="psql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="-c 'create database ${dbname} ENCODING = UTF8 TEMPLATE = template0'"/>
</exec>
<exec executable="psql" input="database/postgresql/schema.sql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="-1"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="${dbname}"/>
</exec>
<exec executable="psql" input="database/postgresql/images.sql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="-1"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="${dbname}"/>
</exec>
<exec executable="psql" input="database/postgresql/data.sql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="-1"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="drop-db-postgresql">
<!-- Drop PostgreSQL database -->
<exec executable="psql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="-c 'drop database if exists ${dbname}'"/>
</exec>
</target>
<target name="init-proxy-postgresql" depends="">
<!-- Create PostgreSQL database -->
<exec executable="psql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="-c 'drop database if exists ${dbname}_proxy'"/>
</exec>
<exec executable="psql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="-c 'create database ${dbname}_proxy ENCODING = UTF8 TEMPLATE = template0'"/>
</exec>
<exec executable="psql" input="database/postgresql/schema.sql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="-1"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="${dbname}_proxy"/>
</exec>
</target>
<target name="init-frontend-postgresql" depends="create-configs,create-saml-configs,make-dbschema,make-gettext,create-db-postgresql,init-frontend-modules">
<exec executable="psql" input="ui/tests/selenium/data/data_test.sql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="-1"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="init-api-postgresql" depends="create-configs,make-dbschema,create-db-postgresql">
<exec executable="psql" input="ui/tests/api_json/data/data_test.sql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="-1"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="init-integration-postgresql" depends="create-configs,init-integration,make-binaries-postgresql,create-db-postgresql,init-proxy-postgresql">
<exec executable="psql" input="ui/tests/integration/data/data_test.sql" failonerror="on">
<env key="PGPASSWORD" value="${dbpassword}"/>
<arg line="-q"/>
<arg line="-h '${dbhost}'"/>
<arg line="-U '${dbuser}'"/>
<arg line="-1"/>
<arg line="--set ON_ERROR_STOP=1"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="make-binaries-mysql">
<!-- Binaries for integration tests -->
<exec executable="./bootstrap.sh" failonerror="on"/>
<exec executable="./configure" failonerror="on">
<arg line="--quiet"/>
<arg line="--enable-server"/>
<arg line="--enable-proxy"/>
<arg line="--enable-agent"/>
<arg line="--enable-agent2"/>
<arg line="--with-mysql"/>
<arg line="--prefix=${basedir}"/>
</exec>
<exec executable="make" failonerror="on">
<arg line="-j4"/>
<arg line="-s"/>
<arg line="dbschema"/>
</exec>
<exec executable="make" failonerror="on">
<arg line="-j4"/>
<arg line="-s"/>
<arg line="install"/>
</exec>
</target>
<target name="create-db-mysql" depends="drop-db-mysql">
<!-- Create MySQL database -->
<exec executable="mysql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="--execute='create database ${dbname} character set utf8 collate utf8_bin'"/>
</exec>
<exec executable="mysql" input="database/mysql/schema.sql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
<exec executable="mysql" input="database/mysql/images.sql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
<exec executable="mysql" input="database/mysql/data.sql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="drop-db-mysql">
<!-- Drop MySQL database -->
<exec executable="mysql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="--execute='drop database if exists ${dbname}'"/>
</exec>
</target>
<target name="init-proxy-mysql" depends="">
<!-- Create MySQL database -->
<exec executable="mysql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="--execute='drop database if exists ${dbname}_proxy'"/>
</exec>
<exec executable="mysql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="--execute='create database ${dbname}_proxy character set utf8 collate utf8_bin'"/>
</exec>
<exec executable="mysql" input="database/mysql/schema.sql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="${dbname}_proxy"/>
</exec>
</target>
<target name="init-frontend-mysql" depends="create-configs,create-saml-configs,make-dbschema,make-gettext,create-db-mysql,init-frontend-modules">
<exec executable="mysql" input="ui/tests/selenium/data/data_test.sql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="init-api-mysql" depends="create-configs,make-dbschema,create-db-mysql">
<exec executable="mysql" input="ui/tests/api_json/data/data_test.sql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="init-integration-mysql" depends="create-configs,init-integration,make-binaries-mysql,create-db-mysql,init-proxy-mysql">
<exec executable="mysql" input="ui/tests/integration/data/data_test.sql" failonerror="on">
<arg line="--host=${dbhost}"/>
<arg line="--user=${dbuser}"/>
<arg line="--password=${dbpassword}"/>
<arg line="${dbname}"/>
</exec>
</target>
<target name="test-phpunit" depends="init-common">
<exec executable="phpunit" dir="ui/tests/unit" failonerror="off">
<arg line="--log-junit=${basedir}/build/logs/phpunit.xml"/>
<arg line="${phpunit_filter}"/>
<arg line="include/"/>
</exec>
</target>
<target name="test-frontend">
<exec executable="phpunit" dir="ui/tests" failonerror="off">
<arg line="--log-junit=${basedir}/build/logs/phpunit.xml"/>
<arg line="--bootstrap=bootstrap.php"/>
<arg line="${phpunit_filter}"/>
<arg line="frontend.php"/>
</exec>
</target>
<target name="test-api">
<exec executable="phpunit" dir="ui/tests" failonerror="off">
<arg line="--log-junit=${basedir}/build/logs/phpunit.xml"/>
<arg line="--bootstrap=bootstrap.php"/>
<arg line="${phpunit_filter}"/>
<arg line="api_json/ApiJsonTests.php"/>
</exec>
</target>
<target name="test-integration">
<exec executable="phpunit" dir="ui/tests" failonerror="off">
<arg line="--log-junit=${basedir}/build/logs/phpunit.xml"/>
<arg line="--bootstrap=bootstrap.php"/>
<arg line="${phpunit_filter}"/>
<arg line="integration/IntegrationTests.php"/>
</exec>
</target>
<target name="build-phpunit" depends="test-phpunit"/>
<target name="build-mysql" depends="init-frontend-mysql,test-frontend"/>
<target name="build-postgresql" depends="init-frontend-postgresql,test-frontend"/>
<target name="build-api-mysql" depends="init-api-mysql,test-api"/>
<target name="build-api-postgresql" depends="init-api-postgresql,test-api"/>
<target name="build-integration-mysql" depends="init-integration-mysql,test-integration"/>
<target name="build-integration-postgresql" depends="init-integration-postgresql,test-integration"/>
<!-- Default target -->
<target name="build" depends="build-phpunit,build-mysql,build-postgresql,build-integration-mysql,build-integration-postgresql"/>
</project>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。