use caching

pull/5370/head
filip mertens 2 years ago
parent f3adbe5721
commit 7486f0c326
  1. 10
      .circleci/config.yml
  2. 2
      apps/remix-ide/.gitignore
  3. 15
      apps/remix-ide/ci/download_e2e_assets.js

@ -28,9 +28,9 @@ jobs:
name: Build name: Build
command: | command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then if [ "${CIRCLE_BRANCH}" == "master" ]; then
NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build:production NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NPM_URL=http://localhost:9090/ yarn build:production
else else
NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NPM_URL=http://localhost:9090/ yarn build
fi fi
- run: yarn run build:e2e - run: yarn run build:e2e
@ -39,7 +39,11 @@ jobs:
keys: keys:
- soljson-{{ checksum "soljson-versions.txt" }} - soljson-{{ checksum "soljson-versions.txt" }}
- run: yarn run downloadsolc_assets_e2e - run: yarn run downloadsolc_assets_e2e
- save_cache:
keys:
- soljson-{{ checksum "soljson-versions.txt" }}
paths:
- dist/apps/remix-ide/assets/js/soljson
- run: mkdir persist && zip -0 -r persist/dist.zip dist - run: mkdir persist && zip -0 -r persist/dist.zip dist
- persist_to_workspace: - persist_to_workspace:

@ -13,4 +13,4 @@ TODO
.tern-port .tern-port
temp_publish_docker temp_publish_docker
src/assets/version.json src/assets/version.json
src/assets/js/soljson-v* src/assets/js/soljson/soljson-v*

@ -4,7 +4,7 @@ var child_process = require('child_process');
const axios = require('axios'); const axios = require('axios');
const { exit } = require('process'); const { exit } = require('process');
var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true });
if (child.error) { if (child.error) {
console.log("ERROR: ", child); console.log("ERROR: ", child);
@ -22,14 +22,17 @@ if (soljson) {
url = `https://binaries.soliditylang.org/bin/soljson${version}.js`; url = `https://binaries.soliditylang.org/bin/soljson${version}.js`;
const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`; const dir = './dist/apps/remix-ide/assets/js/soljson';
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
const path = `./dist/apps/remix-ide/assets/js/soljson/soljson${version}.js`;
// check if the file exists // check if the file exists
const exists = fs.existsSync(path); const exists = fs.existsSync(path);
if (!exists) { if (!exists) {
console.log(url) console.log(url)
// use axios to get the file
try { try {
/*
axios({ axios({
method: 'get', method: 'get',
url: url, url: url,
@ -39,7 +42,9 @@ if (soljson) {
console.log(err); console.log(err);
} }
}) })
})*/ }).catch(function (error) {
console.log(error);
})
} catch (e) { } catch (e) {
console.log('Failed to download soljson' + version + ' from ' + url) console.log('Failed to download soljson' + version + ' from ' + url)
} }

Loading…
Cancel
Save