- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 azure webapp (linux) 上有一个 laravel 应用程序。我正在尝试在部署后运行一些 php 命令。
我正在使用本地 Git 部署到我的 azure 的 web 应用程序。
并按照this guide ,我设置“POST_BUILD_SCRIPT_PATH”来运行名为“postbuild.sh”的脚本
(请注意,我使用的是 .sh 文件,因为我使用的是基于 Linux 的 Web 应用程序。)
问题是我的 postbuild.sh 位置位于“wwwroot”(我的 laravel 根应用程序所在的位置)。但我不断得到
Could not open input file: artisan
当我尝试运行任何 artisan 命令时的消息
php artisan cache:clear
查找后,我发现脚本是从tmp位置执行的。
我应该使用采购在正确的位置运行脚本,但它仍然不起作用。
所以我在“wwwroot”中创建了另一个 .sh 文件,并命名为“clearcache.sh”,并尝试在“postbuild.sh”中获取它,但仍然无法正常工作。
我的 postbuild.sh 是
echo "Post Build .sh"
echo "Script executed from: ${PWD}"
BASEDIR=$(dirname $0)
echo "Script location: ${BASEDIR}"
echo "===================="
source ./home/site/wwwroot/refresh.sh
我的refresh.sh是
echo "Refresh script"
echo "Script executed from: ${PWD}"
BASEDIR=$(dirname $0)
echo "Script location: ${BASEDIR}"
php artisan cache:clear
我在推送到azure repo时遇到的错误是:
remote: Detecting platforms...
remote: Detected following platforms:
remote: php: 7.4.24
remote:
remote: Using intermediate directory '/tmp/8d9a71074a40f5b'.
remote:
remote: Copying files to the intermediate directory...
remote: Done in 0 sec(s).
remote: /home/site/wwwroot/postbuild.sh: line 6: ./home/site/wwwroot/refresh.sh
remote:
remote: : No such file or directory
remote: Source directory : /tmp/8d9a71074a40f5b
remote: Destination directory: /home/site/wwwroot
remote:
remote: Executing pre-build command...
remote: Pre Build
remote: Finished executing pre-build command.
remote: PHP executable: /tmp/oryx/platforms/php/7.4.24/bin/php
remote: No 'composer.json' file found; not running 'composer install'.
remote:
remote: Executing post-build command...
remote: Post Build .sh
remote: Script executed from: /tmp/8d9a71074a40f5b
remote: Script location: /home/site/wwwroot
remote:
remote: ====================
请注意以下事项:
最佳答案
你实际上从未通过执行例如以下操作来切换到BASEDIR
: cd $BASEDIR
所以你的工作目录实际上永远不会改变,所以这是解决这个问题的一种方法:
echo "Refresh script"
echo "Script executed from: ${PWD}"
BASEDIR=$(dirname $0)
echo "Script location: ${BASEDIR}"
$(
cd $BASEDIR
php artisan cache:clear
)
请注意,多行 $(...)
用于执行内容,但完成后保留原始工作目录。
或者你可以这样做:
echo "Refresh script"
echo "Script executed from: ${PWD}"
BASEDIR=$(dirname $0)
echo "Script location: ${BASEDIR}"
php $BASEDIR/artisan cache:clear
关于laravel - 自动部署到 azure linux webapp 后获取 .sh 文件的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69959700/
我有一个在 Tomcat 7.0.54 上运行的 Java webapp。我在 webapp 中使用 Spring。当用户登录到/favicon.ico 时。当用户第二次登录时,他们将被重定向到正确的
如何使用通用的 webappclassloader 为 tomcat 中的所有 webapps 自定义 webapp 类加载器? 我看到我可以扩展类加载器并将其添加到每个 web 应用程序的上下文标记
我有一个 jquery mobile 和 php webapp,可以在 iOS7 中正常工作。我最近升级到 iOS8 进行一些测试,但我遇到了状态栏现在与 Web 应用程序标题重叠的问题。这似乎也导致
我注意到这些文件夹具有非常不同的属性。我最近在 webapps 文件夹下部署了一个 .war 文件。我注意到,一旦部署了 .war 文件,项目的未压缩版本就会添加到目录中。当我尝试修改未压缩版本中的任
假设您在本地主机的 Tomcat 上部署了一个名为 MyWebApp 的网络应用程序。如果您像这样使用浏览器访问它: localhost:8080/MyWebApp 那为什么会显示index.html
我正在寻找一种提示/解决方案来生成一个具有自定义设计的模板 Web 应用程序,然后我所有其他 Web 应用程序都应该采用模板 Web 应用程序的设计。那可能吗?背后的想法是,我们有多个用于项目的 We
我有一扇 Azure 前门。主要区域有一个 azure 功能,辅助区域有一个功能应用程序。当这两个功能都启动时,它工作正常。它正在向每个区域分配 50-50 个负载。但是当我故意停止主要功能时。所有流
这个问题已经有答案了: Getting Python error "from: can't read /var/mail/Bio" (7 个回答) 已关闭去年。 几天前我开始使用 python nfl
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我有一个在 Apache Tomcat 5.5 中完美运行的 Web 应用程序,我需要“转换它”以便它可以部署在 Oracle 应用服务器 10.1.3 中。 现在我制作了一个应用程序的 WAR 文件
我在 jsp 中有 2 个 webapps,其中一个供公共(public)使用,另一个供本地使用。 是否可以在 Apache tomcat 中的一个端口上托管一个 Web 应用程序而在另一个端口上托管
最近,我一直在对模块化JS进行大量试验,但我仍然想知道是否以“正确的方式”编写它。 例如,如果我有一个页面,其中包含输入和提交按钮,这些页面应在提交后显示数据(例如表格和图形),所以我在IFFE下编写
我有一个部署为 web 应用程序的 google 脚本。此 webapp 需要发送带有 webapp 的 URL 的电子邮件,以便收件人可以使用 URL 访问 webapp。如何获取 webapp 中
我们正在部署在.Net core中开发的微服务,并将部署在Azure WebApp中 这些 WebApp 之间将进行大量通信。 现在,由于 WebApp 面向互联网,它们之间的所有调用都将通过互联网,
这个问题已经有答案了: SEVERE: Failed to initialize Jenkins [closed] (1 个回答) 去年关闭。 我在 Ubuntu 12.04 中安装了 Jenkins
我看到一个奇怪的问题。我有两个网络应用程序。一个用于我们使用 Jersey 公开的其余 Web 服务。另一个具有 JSF 前端实现,它调用上面的 web 服务来获取详细信息。我们使用 Tomcat 作
这是我在探索工作场所中某些任务自动化的世界时遇到的一个普遍问题。 我们的企业网站上有一个门户/启动板环境,其中的应用程序显示为图 block 。 其中一个应用程序打开后有一个主页,其中有一堆搜索字段和
我有两个 Google 电子表格,每个电子表格都附加了一些 Apps 脚本。最终,我想将两者部署为 Web 应用程序,以便它们可以通过其公共(public) URL 相互通信。目前,我只部署了其中一个
当我尝试运行 ngserve 时,我得到以下信息 ERROR in ./src/main/webapp/manifest.webapp Module parse failed: /home/ferga
这个问题在这里已经有了答案: Eclipse Output Folders (6 个答案) 关闭 5 年前。 我正在使用 Tomcat 5,当我启动服务器并从 webapp 文件夹加载我的应用程序时
我是一名优秀的程序员,十分优秀!