Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rendezvous
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
rendezvous
Commits
23a14f7e
Commit
23a14f7e
authored
Mar 01, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
travis cache bundlers in S3
parent
6373022d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
17 deletions
+117
-17
.travis.yml
+19
-4
README.md
+16
-13
script/travis/bundle_cache.rb
+74
-0
script/travis/bundle_install.sh
+8
-0
No files found.
.travis.yml
View file @
23a14f7e
bundler_args
:
--without development --path=~/.bundle
language
:
ruby
language
:
ruby
services
:
-
mysql
rvm
:
rvm
:
-
2.0.0
-
2.0.0
env
:
matrix
:
-
DB_TEST_DATABASE=rendezvous_test DB_TEST_USER=travis
global
:
-
secure
:
iCVObmVUWglzaPBvhJ/oCg/0LXFffDyGii/ws2YanPxXs9QsFhVDDj0WtKikK1ZsvZQBADRUJlQwDeTj2VD8rTGsq0Wu9Tjjz82vm+BJ6wb67QMr8HAdi096QeushLKmuVni1HEZcfStltSbmxkZpeRNf2XH9hkjb98g/2x4mzg=
-
BUNDLE_ARCHIVE="rendezvous-travis-bundler"
-
AWS_S3_REGION="us-east-1"
-
AWS_S3_BUCKET="rendezvous-travis-bundler"
-
RAILS_ENV=test
services
:
-
mysql
before_install
:
-
"
echo
'gem:
--no-ri
--no-rdoc'
>
~/.gemrc"
-
gem install bundler fog
-
"
./script/travis/bundle_install.sh"
before_script
:
before_script
:
-
mysql -e 'CREATE DATABASE rendezvous_test;'
-
mysql -e 'CREATE DATABASE rendezvous_test;'
-
cp config/database.yml.example config/database.yml
-
cp config/database.yml.example config/database.yml
-
cp config/settings.yml.example config/settings.yml
-
cp config/settings.yml.example config/settings.yml
env
:
after_script
:
-
DB_TEST_DATABASE=rendezvous_test DB_TEST_USER=travis
-
"
ruby
script/travis/bundle_cache.rb"
script
:
"
bundle
exec
rake
db:create
db:test:load
spec"
README.md
View file @
23a14f7e
...
@@ -6,7 +6,7 @@ rendezvous
...
@@ -6,7 +6,7 @@ rendezvous
[

](https://codeclimate.com/github/tadyjp/rendezvous)
[

](https://codeclimate.com/github/tadyjp/rendezvous)
[

](https://gemnasium.com/tadyjp/rendezvous)
[

](https://gemnasium.com/tadyjp/rendezvous)
A simple markdown-based wiki system for team.
A simple markdown-based
blog &
wiki system for team.
# Supported versions
# Supported versions
...
@@ -38,28 +38,31 @@ and get
...
@@ -38,28 +38,31 @@ and get
5.
Get
[
Client ID
]
and
[
Client secret
]
5.
Get
[
Client ID
]
and
[
Client secret
]
## Create
your .env file
.
## Create
and edit config files
.
```
```
$ cp .env.example .env
$ cp config/database.yml.example config/database.yml
$ vim .env
$ vim config/database.yml
```
Set Google API
[
Client ID
]
and
[
Client secret
]
in
`.env`
$ cp config/settings.yml.example config/settings.yml
$ vim config/settings.yml
```
## Setup DB
(Default: mysql).
## Setup DB
```
```
$ (bundle exec) rake db:migrate
$ (bundle exec) rake db:migrate
$ (bundle exec) rake db:seed
$ (bundle exec) rake db:seed
```
```
And have fun with your team !
## Set ENV before start server.
```
$ source .env
$ (bundle exec) rails s
```
And have fun with your team !
# Test
Rendezvous uses travis-ci for test.
To speet up
`bundle install`
in travis-ci, Rendezvous use AWS S3 backet for storing gems.
see also: http://randomerrata.com/post/45827813818/travis-s3
script/travis/bundle_cache.rb
0 → 100644
View file @
23a14f7e
require
"digest"
require
"fog"
bucket_name
=
ENV
[
"AWS_S3_BUCKET"
]
architecture
=
`uname -m`
.
strip
file_name
=
"
#{
ENV
[
'BUNDLE_ARCHIVE'
]
}
-
#{
architecture
}
.tgz"
file_path
=
File
.
expand_path
(
"~/
#{
file_name
}
"
)
lock_file
=
File
.
join
(
File
.
expand_path
(
ENV
[
"TRAVIS_BUILD_DIR"
]),
"Gemfile.lock"
)
digest_filename
=
"
#{
file_name
}
.sha2"
old_digest
=
File
.
expand_path
(
"~/remote_
#{
digest_filename
}
"
)
puts
"Checking for changes"
bundle_digest
=
Digest
::
SHA2
.
file
(
lock_file
).
hexdigest
old_digest
=
File
.
exists?
(
old_digest
)
?
File
.
read
(
old_digest
)
:
""
if
bundle_digest
==
old_digest
puts
"=> There were no changes, doing nothing"
else
if
old_digest
==
""
puts
"=> There was no existing digest, uploading a new version of the archive"
else
puts
"=> There were changes, uploading a new version of the archive"
puts
" => Old checksum:
#{
old_digest
}
"
puts
" => New checksum:
#{
bundle_digest
}
"
end
puts
"=> Preparing bundle archive"
`cd ~ && tar -cjf
#{
file_name
}
.bundle && split -b 5m -a 3
#{
file_name
}
#{
file_name
}
.`
parts_pattern
=
File
.
expand_path
(
File
.
join
(
"~"
,
"
#{
file_name
}
.*"
))
parts
=
Dir
.
glob
(
parts_pattern
).
sort
storage
=
Fog
::
Storage
.
new
({
:provider
=>
"AWS"
,
:aws_access_key_id
=>
ENV
[
"AWS_S3_KEY"
],
:aws_secret_access_key
=>
ENV
[
"AWS_S3_SECRET"
],
:region
=>
ENV
[
"AWS_S3_REGION"
]
||
"us-east-1"
})
puts
"=> Uploading the bundle"
puts
" => Beginning multipart upload"
response
=
storage
.
initiate_multipart_upload
bucket_name
,
file_name
,
{
"x-amz-acl"
=>
"public-read"
}
upload_id
=
response
.
body
[
'UploadId'
]
puts
" => Upload ID:
#{
upload_id
}
"
part_ids
=
[]
puts
" => Uploading
#{
parts
.
length
}
parts"
parts
.
each_with_index
do
|
part
,
index
|
part_number
=
(
index
+
1
).
to_s
puts
" => Uploading
#{
part
}
"
File
.
open
part
do
|
part_file
|
response
=
storage
.
upload_part
bucket_name
,
file_name
,
upload_id
,
part_number
,
part_file
part_ids
<<
response
.
headers
[
'ETag'
]
puts
" => Uploaded"
end
end
puts
" => Completing multipart upload"
storage
.
complete_multipart_upload
bucket_name
,
file_name
,
upload_id
,
part_ids
puts
"=> Uploading the digest file"
bucket
=
storage
.
directories
.
new
(
key:
bucket_name
)
bucket
.
files
.
create
({
:body
=>
bundle_digest
,
:key
=>
digest_filename
,
:public
=>
true
,
:content_type
=>
"text/plain"
})
end
puts
"All done now."
exit
0
script/travis/bundle_install.sh
0 → 100644
View file @
23a14f7e
ARCHITECTURE
=
`
uname
-m
`
FILE_NAME
=
"
$BUNDLE_ARCHIVE
-
$ARCHITECTURE
.tgz"
cd
~
wget
-O
"remote_
$FILE_NAME
"
"https://
$AWS_S3_BUCKET
.s3.amazonaws.com/
$FILE_NAME
"
&&
tar
-xf
"remote_
$FILE_NAME
"
wget
-O
"remote_
$FILE_NAME
.sha2"
"https://
$AWS_S3_BUCKET
.s3.amazonaws.com/
$FILE_NAME
.sha2"
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment