doucan8246326 2016-12-30 14:50
浏览 66

Jenkins PHP工作中的Codeception

Created the following Dockerfile on top of the Jenkins image:

Dockerfile

FROM jenkins
MAINTAINER lh <lh@example.com>

USER root

#install required modules
RUN apt-get -y update && apt-get install -y \
    phpunit \
    php5-curl

#install composer & codeception & magellanes
RUN curl -s http://getcomposer.org/installer | php \
    && mv composer.phar /usr/local/bin/composer \
    && curl -LsS http://codeception.com/codecept.phar -o /usr/local/bin/codecept \
    && chmod a+x /usr/local/bin/codecept \
    && wget http://download.magephp.com/magallanes.latest.tar.gz -O magallanes.tar.gz \
    && tar xfz magallanes.tar.gz \
    && cd magallanes \
    && bin/mage install --installDir=/opt/magallanes

#set date.timezone
RUN sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php5/cli/php.ini

USER jenkins

Everything works well and I can build my PHP project. However, my acceptance test fails because I do not know what url I have to configure.

Codeception configuration

class_name: AcceptanceTester
modules:
    enabled:
        - PhpBrowser:
            url: http://localhost/myapp
        - \Helper\Acceptance

What should the url be? Jenkins places the project inside /var/jenkins_home/workspace.

Jenkins pipeline script

node {
    stage('Preparation') {
        git 'git@bitbucket.org:foo/bar.git'
    }
    stage('Build') {
        sh 'mkdir -p app/cache app/logs web/media/cache web/uploads'
        sh 'composer install'
    }
    stage('Test') {
        sh 'codecept run'
    }
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 测距传感器数据手册i2c
    • ¥15 RPA正常跑,cmd输入cookies跑不出来
    • ¥15 求帮我调试一下freefem代码
    • ¥15 matlab代码解决,怎么运行
    • ¥15 R语言Rstudio突然无法启动
    • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
    • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
    • ¥15 用windows做服务的同志有吗
    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法