Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
8e967737
Commit
8e967737
authored
Nov 13, 2018
by
Ben Wheeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use production or staging hosts for static assets url
parent
c965fd15
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
.travis.yml
.travis.yml
+5
-0
src/lib/user-thumbnail.js
src/lib/user-thumbnail.js
+2
-1
webpack.config.js
webpack.config.js
+2
-1
No files found.
.travis.yml
View file @
8e967737
...
...
@@ -43,6 +43,11 @@ env:
-
PROJECT_HOST_VAR=PROJECT_HOST_$TRAVIS_BRANCH
-
PROJECT_HOST=${!PROJECT_HOST_VAR}
-
PROJECT_HOST=${PROJECT_HOST:-$PROJECT_HOST_STAGING}
-
STATIC_HOST_master=https://cdn2.scratch.mit.edu
-
STATIC_HOST_STAGING=https://scratch.ly
-
STATIC_HOST_VAR=STATIC_HOST_$TRAVIS_BRANCH
-
STATIC_HOST=${!STATIC_HOST_VAR}
-
STATIC_HOST=${STATIC_HOST:-$STATIC_HOST_STAGING}
-
PATH=$PATH:$PWD/test/integration/node_modules/chromedriver/bin
-
AWS_ACCESS_KEY_ID=$EB_AWS_ACCESS_KEY_ID
-
AWS_SECRET_ACCESS_KEY=$EB_AWS_SECRET_ACCESS_KEY
...
...
src/lib/user-thumbnail.js
View file @
8e967737
...
...
@@ -11,7 +11,8 @@
* @returns {string} thumbnail url string
*/
const
thumbnailUrl
=
(
userId
,
width
,
height
)
=>
(
`/get_image/user/
${
userId
}
_
${
width
?
width
:
32
}
x
${
height
?
height
:
(
width
?
width
:
32
)}
.png`
`
${
process
.
env
.
STATIC_HOST
}
/get_image/user/
${
userId
}
_`
+
`
${
width
?
width
:
32
}
x
${
height
?
height
:
(
width
?
width
:
32
)}
.png`
);
module
.
exports
=
thumbnailUrl
;
webpack.config.js
View file @
8e967737
...
...
@@ -33,7 +33,7 @@ VersionPlugin.prototype.apply = function (compiler) {
callback
();
};
const
options
=
this
.
options
;
compiler
.
plugin
(
'
emit
'
,
function
(
compilation
,
callback
)
{
const
sha
=
process
.
env
.
WWW_VERSION
;
if
(
!
sha
)
{
// eslint-disable-line no-negated-condition
...
...
@@ -169,6 +169,7 @@ module.exports = {
'
process.env.BACKPACK_HOST
'
:
'
"
'
+
(
process
.
env
.
BACKPACK_HOST
||
'
https://backpack.scratch.mit.edu
'
)
+
'
"
'
,
'
process.env.CLOUDDATA_HOST
'
:
'
"
'
+
(
process
.
env
.
CLOUDDATA_HOST
||
'
clouddata.scratch.mit.edu
'
)
+
'
"
'
,
'
process.env.PROJECT_HOST
'
:
'
"
'
+
(
process
.
env
.
PROJECT_HOST
||
'
https://projects.scratch.mit.edu
'
)
+
'
"
'
,
'
process.env.STATIC_HOST
'
:
'
"
'
+
(
process
.
env
.
STATIC_HOST
||
'
https://cdn2.scratch.mit.edu
'
)
+
'
"
'
,
'
process.env.SCRATCH_ENV
'
:
'
"
'
+
(
process
.
env
.
SCRATCH_ENV
||
'
development
'
)
+
'
"
'
}),
new
webpack
.
optimize
.
CommonsChunkPlugin
({
...
...
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