Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
498f00a2
Commit
498f00a2
authored
Dec 14, 2013
by
Chris Rebert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use S3-cached Jekyll install
parent
6bb73df5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
.travis.yml
.travis.yml
+8
-4
test-infra/s3_cache.py
test-infra/s3_cache.py
+8
-8
No files found.
.travis.yml
View file @
498f00a2
...
@@ -2,15 +2,19 @@ language: node_js
...
@@ -2,15 +2,19 @@ language: node_js
node_js
:
node_js
:
-
0.10
-
0.10
before_install
:
before_install
:
-
time sudo pip install --use-mirrors -r ./test-infra/requirements.txt
-
time sudo pip install --use-mirrors -r test-infra/requirements.txt
-
rvm use 1.9.3 --fuzzy
-
if [ "$TWBS_TEST" = validate-html ]; then echo "ruby=$(basename $(rvm gemdir)) jekyll=$JEKYLL_VERSION" > pseudo_Gemfile.lock; fi
install
:
install
:
-
if [ "$TWBS_TEST" = validate-html ]; then time gem install jekyll; fi
-
time npm install -g grunt-cli
-
time npm install -g grunt-cli
-
time ./test-infra/node_modules_cache.py download package.json ./node_modules || time npm install
-
time ./test-infra/s3_cache.py download 'node.js packages' package.json ./node_modules || time npm install
-
if [ "$TWBS_TEST" = validate-html ]; then time ./test-infra/s3_cache.py download rubygems pseudo_Gemfile.lock $(rvm gemdir) || gem install -N jekyll -v $JEKYLL_VERSION; fi
after_script
:
after_script
:
-
if [ "$TWBS_TEST" = core ]; then time ./test-infra/node_modules_cache.py upload package.json ./node_modules; fi
-
if [ "$TWBS_TEST" = core ]; then time ./test-infra/s3_cache.py upload 'node.js packages' package.json ./node_modules; fi
-
if [ "$TWBS_TEST" = validate-html ]; then time ./test-infra/s3_cache.py upload rubygems pseudo_Gemfile.lock $(rvm gemdir); fi
env
:
env
:
global
:
global
:
-
JEKYLL_VERSION
:
1.4.1
-
SAUCE_USERNAME
:
bootstrap
-
SAUCE_USERNAME
:
bootstrap
-
secure
:
"
pJkBwnuae9dKU5tEcCqccfS1QQw7/meEcfz63fM7ba7QJNjoA6BaXj08L5Z3Vb5vBmVPwBawxo5Hp0jC0r/Z/O0hGnAmz/Cz09L+cy7dSAZ9x4hvZePSja/UAusaB5ogMoO8l2b773MzgQeSmrLbExr9BWLeqEfjC2hFgdgHLaQ="
-
secure
:
"
pJkBwnuae9dKU5tEcCqccfS1QQw7/meEcfz63fM7ba7QJNjoA6BaXj08L5Z3Vb5vBmVPwBawxo5Hp0jC0r/Z/O0hGnAmz/Cz09L+cy7dSAZ9x4hvZePSja/UAusaB5ogMoO8l2b773MzgQeSmrLbExr9BWLeqEfjC2hFgdgHLaQ="
-
secure
:
"
gqjqISbxBJK6byFbsmr1AyP1qoWH+rap06A2gI7v72+Tn2PU2nYkIMUkCvhZw6K889jv+LhQ/ybcBxDOXHpNCExCnSgB4dcnmYp+9oeNZb37jSP0rQ+Ib4OTLjzc3/FawE/fUq5kukZTC7porzc/k0qJNLAZRx3YLALmK1GIdUY="
-
secure
:
"
gqjqISbxBJK6byFbsmr1AyP1qoWH+rap06A2gI7v72+Tn2PU2nYkIMUkCvhZw6K889jv+LhQ/ybcBxDOXHpNCExCnSgB4dcnmYp+9oeNZb37jSP0rQ+Ib4OTLjzc3/FawE/fUq5kukZTC7porzc/k0qJNLAZRx3YLALmK1GIdUY="
...
...
test-infra/
node_modules
_cache.py
→
test-infra/
s3
_cache.py
View file @
498f00a2
...
@@ -58,22 +58,22 @@ def _extract_tarball(directory):
...
@@ -58,22 +58,22 @@ def _extract_tarball(directory):
def
download
(
directory
):
def
download
(
directory
):
_delete_file_quietly
(
NEED_TO_UPLOAD_MARKER
)
_delete_file_quietly
(
NEED_TO_UPLOAD_MARKER
)
try
:
try
:
print
(
"Downloading {} tarball from S3..."
.
format
(
basename
(
directory
)
))
print
(
"Downloading {} tarball from S3..."
.
format
(
friendly_name
))
key
.
get_contents_to_filename
(
_tarball_filename_for
(
directory
))
key
.
get_contents_to_filename
(
_tarball_filename_for
(
directory
))
except
S3ResponseError
as
err
:
except
S3ResponseError
as
err
:
open
(
NEED_TO_UPLOAD_MARKER
,
'a'
)
.
close
()
open
(
NEED_TO_UPLOAD_MARKER
,
'a'
)
.
close
()
print
(
err
)
print
(
err
)
raise
SystemExit
(
"Cached {} download failed!"
.
format
(
basename
(
directory
)
))
raise
SystemExit
(
"Cached {} download failed!"
.
format
(
friendly_name
))
print
(
"Downloaded {}."
.
format
(
_tarball_size
(
directory
)))
print
(
"Downloaded {}."
.
format
(
_tarball_size
(
directory
)))
_extract_tarball
(
directory
)
_extract_tarball
(
directory
)
print
(
"{} successfully installed from cache."
.
format
(
directory
))
print
(
"{} successfully installed from cache."
.
format
(
friendly_name
))
def
upload
(
directory
):
def
upload
(
directory
):
_create_tarball
(
directory
)
_create_tarball
(
directory
)
print
(
"Uploading {} tarball to S3... ({})"
.
format
(
basename
(
directory
)
,
_tarball_size
(
directory
)))
print
(
"Uploading {} tarball to S3... ({})"
.
format
(
friendly_name
,
_tarball_size
(
directory
)))
key
.
set_contents_from_filename
(
_tarball_filename_for
(
directory
))
key
.
set_contents_from_filename
(
_tarball_filename_for
(
directory
))
print
(
"{} cache successfully updated."
.
format
(
directory
))
print
(
"{} cache successfully updated."
.
format
(
friendly_name
))
_delete_file_quietly
(
NEED_TO_UPLOAD_MARKER
)
_delete_file_quietly
(
NEED_TO_UPLOAD_MARKER
)
...
@@ -82,9 +82,9 @@ if __name__ == '__main__':
...
@@ -82,9 +82,9 @@ if __name__ == '__main__':
# AWS_ACCESS_KEY_ID - AWS Access Key ID
# AWS_ACCESS_KEY_ID - AWS Access Key ID
# AWS_SECRET_ACCESS_KEY - AWS Secret Access Key
# AWS_SECRET_ACCESS_KEY - AWS Secret Access Key
argv
.
pop
(
0
)
argv
.
pop
(
0
)
if
len
(
argv
)
!=
3
:
if
len
(
argv
)
!=
4
:
raise
SystemExit
(
"USAGE: node_modules_cache.py <download | upload> <dependencies file> <directory>"
)
raise
SystemExit
(
"USAGE: node_modules_cache.py <download | upload> <
friendly name> <
dependencies file> <directory>"
)
mode
,
dependencies_file
,
directory
=
argv
mode
,
friendly_name
,
dependencies_file
,
directory
=
argv
conn
=
S3Connection
()
conn
=
S3Connection
()
bucket
=
conn
.
lookup
(
BUCKET_NAME
)
bucket
=
conn
.
lookup
(
BUCKET_NAME
)
...
...
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