dongnai8013 2014-05-16 02:04
浏览 63
已采纳

OpenShift动作钩子部署问题

I have a symfony 2 project I am trying to launch on OpenShift online. I created the directory as required and running symfony locally works perfect.

However, when I deploy to my OpenShift application the deploy and post_deploy action_hooks do not run. I do not even see the output on git push like they mention in the documentation.

I should also note that I can ssh into the app and create a test.sh that will run the exact same code and work as intended.

Any help would be greatly appreciated, I've placed multiple tickets with the support staff and no luck.

Here is a link to a screenshot of the directory structure:

https://www.dropbox.com/s/oup9fa3rfgw43wy/Screenshot%202014-05-15%2019.03.21.png

Below is my post_deploy hook:

#!/bin/bash
# This deploy hook gets executed after dependencies are resolved and the
# build hook has been run but before the application has been started back
# up again.  This script gets executed directly, so it could be python, php,
# ruby, etc.

# set the location for composer home to the data dir
export COMPOSER_HOME="$OPENSHIFT_DATA_DIR/.composer"

# check if composer exists in data dir
if [ ! -f "$OPENSHIFT_DATA_DIR/composer.phar" ]; then
    curl -s https://getcomposer.org/installer | /opt/rh/php54/root/usr/bin/php -- --install-dir=$OPENSHIFT_DATA_DIR
else
    /opt/rh/php54/root/usr/bin/php $OPENSHIFT_DATA_DIR/composer.phar self-update
fi

# check and set the symlink for vendor dir
if [ ! -d "$OPENSHIFT_DATA_DIR/vendor" ]; then
    echo !!! vendor directory does NOT exist - creating symlink...
    mkdir $OPENSHIFT_DATA_DIR/vendor
    echo !!! created vendor directory - creating symlink...
    ln -s $OPENSHIFT_DATA_DIR/vendor $OPENSHIFT_REPO_DIR/vendor
    echo !!! created symlink - setting permissions on directory...
    chmod -R 0777 $OPENSHIFT_DATA_DIR/vendor
    echo !!! permissions have been set on vendor directory!
else
    echo !!! vendor directory already exists - skipping symlink...
fi

// shortened for brevity, but the rest is the same.

# use composer install
( unset GIT_DIR ; cd $OPENSHIFT_REPO_DIR ; /opt/rh/php54/root/usr/bin/php $OPENSHIFT_DATA_DIR/composer.phar install )
  • 写回答

2条回答 默认 最新

  • donglan8999 2014-05-16 02:59
    关注

    Make sure that you are making your action_hooks executable (chmod +x) and then adding that information to git, and do a git push. On Windows, you'll need to run:

    git update-index --chmod=+x .openshift/action_hooks/*
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,