2017-01-28 43 views
1

我想要在生产模式下生成Web应用程序(运行grunt build),并通过git ftp使用bitbucket流水线将我生成的文件和文件夹从webhost上的文件夹中推送出去。如何运行grunt构建以通过bitbucket管道部署web应用程序?

到位桶web应用结构

app[dir] 
tests[dir] 
.gitignore 
Gruntfile.js 
bitbucket-pipelines.yml 
bower.json 
package.json 
... 

gitignore

/node_modules 
/dist 
/.tmp 
/.sass-cache 
/bower_components 

# OS generated files # 
###################### 
.DS_Store 
.DS_Store? 
._* 
.Spotlight-V100 
.Trashes 
Icon? 
ehthumbs.db 
Thumbs.db 
log 
node_modules 
node 

# Personal application yamls # 
############################## 
*bitbucket-pipelines.yml 
src/main/resources/static/js/vendor 
application-cat.yml 
.tern-project 
bitbucket-pipelines.yml 
.idea/workspace.xml 

到位桶-pipelines.yml

image: node:4.6.0 

pipelines: 
    default: 
    - step: 
     script: 
     - apt-get update 
     - apt-get -qq install git-ftp 
     - npm install 
     - npm install -g grunt-cli 
     - npm install -g [email protected] 
     - npm install -g bower 
     - bower install --allow-root 
     - grunt build 
     - git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://myDomain.com/public_html/folder/ 

注意

如果我在本地运行“咕噜打造”它会产生在我的根应用程序名称的文件夹:DIST(女巫是OK !!)。 如果我运行bitbucket.pipelines.yml脚本(全部成功),它将不会生成任何文件夹(女巫不是好的!!)。

结论

我结束了推我的虚拟主机提供商的所有资源库,因为我不能针对任何DIST文件夹。有什么建议么 ?

+0

我有同样的问题,你有没有找到任何解决办法? – Gowri

+0

@Gowri你好,不...然后我还没有搜索其他解决方案... – que1326

回答

1

我们需要使用git的-FTP-包括文件,包括未跟踪文件。如果咕噜生成生成文件夹。然后,我们需要在.git-ftp-include中添加以下内容以强制build文件夹处于同步过程中。

!build/ 

希望这将有助于

+0

感谢您的回复先生,我会尽快检查 – que1326

相关问题