为了了解更多关于heroku调度的信息,我阅读了这文章并构建了其中描述的应用程序。这篇文章的关键部分是当我能够执行heroku run numCheck和numCheck文件中的代码时。在测试了heroku run numCheck的工作之后,我能够很好地安排在Heroku经常发生的事件。
我用yo角-全堆栈来创建我的应用程序,天使洞察,它是功能性的。不过,我想增加heroku的调度功能,但是我被卡住了。我的问题是,在运行heroku run refresh之后,无法在Dist文件夹中运行grunt build。这是我特别尝试过的..。
```javascript#!/usr/bin/env节点
var sendgrid =需要量(‘sendgrid’)(
process.env.SENDGRID_USERNAME,
process.env.SENDGRID_PASSWORD
);
变量num1 = Math.ceil(Math.random() * 100);
变量num2 = Math.ceil(Math.random() * 100);
var比较器;
if (num1 > num2) {
comparator = "greater than";} else if (num1 < num2) {
comparator = "less than";}否则{
comparator = "equal to";}
sendgrid.send({
to: 'andrewscheuermann@gmail.com',from: 'scheduler@tester.com',subject: 'Num1 v Num2',text: (num1 + ' is ' + comparator + " " + num2 + ".")},函数(err,json) {
if (err) { console.error(err);}
我真的被困住了,任何洞察力都是非常感谢的!
发布于 2014-08-05 15:45:30
使用角度生成器,您必须小心它覆盖dist目录。每次您grunt build时,您都要从一个主要是干净的dist dir开始。
这些步骤应该类似于:
grunt buildcp refresh dist/refreshcd dist && git commitgit push heroku masterheroku run refresh缺少的主要步骤是,在复制文件后,必须将复制的文件提交到dist中,否则heroku将无法得到它。您始终可以执行heroku run ls或heroku run bash来查看您的文件是否存在。
工作完成后,您应该查看您的Gruntfile.js,以确保每次在那里复制refresh,您可能希望查看copy任务。
https://stackoverflow.com/questions/25097198
复制相似问题