mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-16 16:19:48 -05:00
use production or staging hosts for static assets url
This commit is contained in:
parent
c965fd15f9
commit
8e967737e5
3 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue