Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
3cba4e5d
H
hub
项目概览
github
/
hub
10 个月 前同步成功
通知
3
Star
22523
Fork
2406
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
3cba4e5d
编写于
12月 24, 2014
作者:
M
Mislav Marohnić
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove custom Bundler to S3 cache scripts
This is now handled by Travis
上级
4e12d8f3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
122 deletion
+0
-122
.travis.yml
.travis.yml
+0
-5
script/cached-bundle
script/cached-bundle
+0
-46
script/s3-put
script/s3-put
+0
-71
未找到文件。
.travis.yml
浏览文件 @
3cba4e5d
...
...
@@ -14,8 +14,3 @@ cache:
-
vendor/bundle
notifications
:
email
:
false
env
:
global
:
-
AMAZON_S3_BUCKET=ci-cache
-
AMAZON_ACCESS_KEY_ID=AKIAJQCVTDEWQHRPBPGQ
-
secure
:
"
XAZv5xyNjWt7F9hG0MZhDANVJ5h/ajEZvfJOEIZRQlE3X5x6oVgI8blLh/MmlRSF0kIyLckcn6t2ccjSOvwN2hca5bwZSjIqoKbJyNe2cmkxfi2432vEOu3Ve6PT5hZWX4R5RgT+xWyMjIJcdF3gUMP7ErXl64aEncBzeW6OoXM="
script/cached-bundle
已删除
100755 → 0
浏览文件 @
4e12d8f3
#!/usr/bin/env bash
# Usage: cached-bundle install --deployment
#
# After running `bundle`, caches the `vendor/bundle` directory to S3.
# On the next run, restores the cached directory before running `bundle`.
# When `Gemfile.lock` changes, the cache gets rebuilt.
#
# Requirements:
# - Gemfile.lock
# - TRAVIS_REPO_SLUG
# - TRAVIS_RUBY_VERSION
# - AMAZON_S3_BUCKET
# - script/s3-put
# - bundle
# - curl
#
# Author: Mislav Marohnić
set
-e
compute_md5
()
{
local
output
=
"
$(
openssl md5
)
"
echo
"
${
output
##*
}
"
}
download
()
{
curl
--tcp-nodelay
-qsfL
"
$1
"
-o
"
$2
"
}
bundle_path
=
"vendor/bundle"
gemfile_hash
=
"
$(
compute_md5 <
"
${
BUNDLE_GEMFILE
:-
Gemfile
}
.lock"
)
"
cache_name
=
"
${
TRAVIS_RUBY_VERSION
}
-
${
gemfile_hash
}
.tgz"
fetch_url
=
"http://
${
AMAZON_S3_BUCKET
}
.s3.amazonaws.com/
${
TRAVIS_REPO_SLUG
}
/
${
cache_name
}
"
if
download
"
$fetch_url
"
"
$cache_name
"
;
then
echo
"Reusing cached bundle
${
cache_name
}
"
tar
xzf
"
$cache_name
"
fi
bundle
"
$@
"
if
[
!
-f
"
$cache_name
"
]
&&
[
-n
"
$AMAZON_SECRET_ACCESS_KEY
"
]
;
then
echo
"Caching
\`
${
bundle_path
}
' to S3"
tar
czf
"
$cache_name
"
"
$bundle_path
"
script/s3-put
"
$cache_name
"
"
${
AMAZON_S3_BUCKET
}
:
${
TRAVIS_REPO_SLUG
}
/
${
cache_name
}
"
fi
script/s3-put
已删除
100755 → 0
浏览文件 @
4e12d8f3
#!/usr/bin/env bash
# Usage: s3-put <FILE> <S3_BUCKET>[:<PATH>] [<CONTENT_TYPE>]
#
# Uploads a file to the Amazon S3 service.
# Outputs the URL for the newly uploaded file.
#
# Requirements:
# - AMAZON_ACCESS_KEY_ID
# - AMAZON_SECRET_ACCESS_KEY
# - openssl
# - curl
#
# Author: Mislav Marohnić
set
-e
authorization
()
{
local
signature
=
"
$(
string_to_sign | hmac_sha1 |
base64
)
"
echo
"AWS
${
AMAZON_ACCESS_KEY_ID
?
}
:
${
signature
}
"
}
hmac_sha1
()
{
openssl dgst
-binary
-sha1
-hmac
"
${
AMAZON_SECRET_ACCESS_KEY
?
}
"
}
base64
()
{
openssl enc
-base64
}
bin_md5
()
{
openssl dgst
-binary
-md5
}
string_to_sign
()
{
echo
"
$http_method
"
echo
"
$content_md5
"
echo
"
$content_type
"
echo
"
$date
"
echo
"x-amz-acl:
$acl
"
printf
"/
$bucket
/
$remote_path
"
}
date_string
()
{
LC_TIME
=
C
date
"+%a, %d %h %Y %T %z"
}
file
=
"
$1
"
bucket
=
"
${
2
%%
:
*
}
"
remote_path
=
"
${
2
#*
:
}
"
content_type
=
"
$3
"
if
[
-z
"
$remote_path
"
]
||
[
"
$remote_path
"
=
"
$bucket
"
]
;
then
remote_path
=
"
${
file
##*/
}
"
fi
http_method
=
PUT
acl
=
"public-read"
content_md5
=
"
$(
bin_md5 <
"
$file
"
|
base64
)
"
date
=
"
$(
date_string
)
"
url
=
"https://
$bucket
.s3.amazonaws.com/
$remote_path
"
curl
-qsSf
-T
"
$file
"
\
-H
"Authorization:
$(
authorization
)
"
\
-H
"x-amz-acl:
$acl
"
\
-H
"Date:
$date
"
\
-H
"Content-MD5:
$content_md5
"
\
-H
"Content-Type:
$content_type
"
\
"
$url
"
echo
"
$url
"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录