Skip to content

Commit

Permalink
chore: fixing circleci script
Browse files Browse the repository at this point in the history
  • Loading branch information
obecny committed Aug 31, 2020
1 parent 7a76375 commit fe39b2a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 23 deletions.
23 changes: 10 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ cache_1: &cache_1
- plugins/node/opentelemetry-plugin-mysql/node_modules
- plugins/node/opentelemetry-plugin-express/node_modules
- propagators/opentelemetry-propagator-jaeger/node_modules
- propagators/opentelemetry-propagator-grpc-census-binary/node_modules
- packages/opentelemetry-rca-metrics/node_modules
- packages/opentelemetry-test-utils/node_modules

node_unit_tests: &node_unit_tests
resource_class: large
Expand All @@ -75,7 +77,7 @@ node_unit_tests: &node_unit_tests
echo "CIRCLE_NODE_VERSION=${CIRCLE_NODE_VERSION}"
- restore_cache:
keys:
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}
- run:
name: Install Root Dependencies
command: npm install --ignore-scripts
Expand Down Expand Up @@ -110,7 +112,7 @@ browsers_unit_tests: &browsers_unit_tests
echo "CIRCLE_NODE_VERSION=${CIRCLE_NODE_VERSION}"
- restore_cache:
keys:
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}
- run:
name: Install Root Dependencies
command: npm install --ignore-scripts
Expand Down Expand Up @@ -151,9 +153,7 @@ build_metrics: &build_metrics
command: npm install --ignore-scripts
- run:
name: Boostrap dependencies
command: npx lerna bootstrap --scope @opentelemetry/rca-metrics --include-filtered-dependencies
- save_cache:
<<: *cache_1
command: npx lerna bootstrap --scope @opentelemetry/rca-metrics --include-filtered-dependencies --ignore-scripts
- run:
name: Create prebuilds for native stats
command: npm run build:rca-metrics
Expand Down Expand Up @@ -208,11 +208,8 @@ workflows:
- node10
- node12
- node12-browsers
- build-native-stats

# - build-native-stats:
# filters:
# branches:
# only: master
#

- build-native-stats:
filters:
branches:
only:
- master
1 change: 0 additions & 1 deletion packages/opentelemetry-rca-metrics/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
artifacts/*
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15650db2e6cb69f2f7f36a5bbe0896c7398e7d77
18 changes: 9 additions & 9 deletions packages/opentelemetry-rca-metrics/scripts/get_prebuilds.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ const os = require('os');
const path = require('path');
const exec = require('./exec.js');

console.log('Downloading and compiling files for release.');
const MAIN_FOLDER = path.resolve(__dirname, '..');
const ARTIFACTS_FOLDER = path.resolve(MAIN_FOLDER, 'artifacts');

console.log('Downloading rca-metrics compiled files for release.');

const TOKEN = process.env.CIRCLE_TOKEN;
if (!TOKEN) {
throw new Error(
[
Expand Down Expand Up @@ -69,7 +71,6 @@ getPipeline()
.then(downloadArtifacts)
.then(validatePrebuilds)
.then(copyPrebuilds)
.then(bundle)
.catch(e => {
process.exitCode = 1;
console.error(e);
Expand Down Expand Up @@ -186,15 +187,14 @@ function validatePrebuilds() {
}

function copyPrebuilds() {
const basename = path.normalize(path.join(__dirname, '..', 'artifacts'));
const filename = 'prebuilds.tgz';

fs.copyFileSync(
path.join(os.tmpdir(), filename),
path.join(basename, filename)
path.join(ARTIFACTS_FOLDER, filename)
);
fs.copyFileSync(
path.join(os.tmpdir(), `${filename}.sha1`),
path.join(ARTIFACTS_FOLDER, `${filename}.sha1`)
);
}

function bundle() {
exec('yarn bundle');
}

0 comments on commit fe39b2a

Please sign in to comment.