Created
May 21, 2014 11:43
-
-
Save katapad/6da71517aad1321e7599 to your computer and use it in GitHub Desktop.
Gruntでプチバージョン管理♥ぽいアップロードのやりかた ref: http://qiita.com/katapad/items/3ab543904f0bf73d7145
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ grunt testup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grunt v0.4.5で動きます | |
# 日付を作る | |
# build-versionオプションが設定されてなかったら、いまの時間を設定する | |
revision = grunt.option('build-version') or grunt.template.today('yyyy-mm-dd_HH-MM-ss') | |
# アップロードする場所を決める | |
uploadPath = "hogehoge/assets/#{revision}" | |
# ~~~~ 中略 ~~~~~ | |
grunt.initConfig | |
'sftp-deploy': | |
develop: | |
auth: hogehoge | |
src: 'public' | |
dest: uploadPath | |
exclusions: ['.DS_Store'] | |
grunt.registerTask 'testup', ['sftp-deploy:develop'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment