Tag: cakephp

Bitbucketpipe道:将cakephp图像与mysql图像链接在一起

我正在使用Bitbucket piplines。 我有两个图像:cakephp图像和mysql图像。 所以我想指定mysql映像作为服务,所以我可以在我的cakephp映像中使用它。 但问题是:cakephp容器没有看到这个服务。 这里是我使用https://confluence.atlassian.com/bitbucket/test-with-databases-in-bitbucket-pipelines-856697462.html创build的bitbucket-pipelines.yml文件: image: handkock/cakephptests:1.0 pipelines: default: – step: script: – mysql -u root -e "use db; source /opt/atlassian/pipelines/agent/build/db_dump.sql;" – mysql -u root -e "CREATE DATABASE DB2; use DB2; source /opt/atlassian/pipelines/agent/build/db2.sql;" services: -mysql custom: # Pipelines that are triggered manually test: # The name that is displayed in the list in the […]

如何避免在多分支pipe道中进行双重结账

当运行一个工作时,SVN仓库被检出,将Jenkinsfile(存储在我的应用程序的根目录)放到workspace/branch_name@script , workspace/branch_name@script再次检出到workspace/branch_name 。 构build需要35-40分钟(大型应用程序,CakePHP)。 Jenkinsfile: #!groovy pipeline { agent any stages { stage('Build Environment & Test App') { steps { sh 'chmod +x ./scripts/* ./application/app/Console/cake' sh 'make test' junit 'junit.xml' } } } } 做testing: #!/bin/bash -e CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # `JOB_BASE_NAME` set from Jenkins global environment variables export DOCKER_COMPOSE_PREFIX="${JOB_BASE_NAME:-test}" shopt -s […]

CakePHP – 如何通过在CakePHP项目中使用套接字连接到docker的db容器

我正试图通过使用docker而不是MAMP来开发我的web应用程序。 这是我第一次做这个工作。 做了很多search之后。 我终于能够链接到我的数据库容器,并看到标准的所有绿色的CakePHP默认页面。 但是当我尝试使用下面的CakePHP的烘焙function。 bin/cake bake all users 我得到了下面的错误。 Exception: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in [CakePhpProjects/cakephptest/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php, line 48] 但是当我使用MAMP的环境并且在config / app.php的“DataResource”的地方添加了下面的代码时,同样的function正在工作。 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock', 那么有什么办法来解决这个问题? 我的DockerFile是这样的。 FROM ubuntu RUN apt-get update \ && apt-get install -y \ composer \ curl \ php \ php-intl \ php-mbstring […]

GitLab CI Docker CakePHP 2testing不起作用

我在Docker容器中通过PHPUnittestingCakePHP2应用程序时遇到一些问题。 CakePHP2 testing指南指出,与CakePHP2兼容的最后一个PHPUnit版本是3.7.38。 我正在使用这个版本,但我仍然得到以下错误: 警告错误:include(PHPUnit / Autoload.php):未能打开stream:[/builds/application_folder/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php,第162行中没有这样的文件或目录] 警告错误:include():打开“PHPUnit / Autoload.php”失败(include_path ='/ builds / zb2 / kswf / lib:。:/ usr / local / lib / php')in [/ builds / application_folder / lib / Cake / TestSuite / CakeTestSuiteDispatcher.php,第162行] 有一个与这个错误有关的问题 ,但它是通过从PHPUnit 4降级到PHPUnit 3来解决的。 这里是我用于GitLab Runner的图像的Dockerfile FROM php:5 RUN apt-get update -y RUN apt-get install -y wget RUN […]