From 53b9788a0fe2b2b89013caed4641f297a6d24a3a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 7 Aug 2018 09:56:47 -0700 Subject: [PATCH 1/2] chore: ignore package-log.json --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 987f87f..15bd16f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ key.json package-lock.json .vscode build +package-lock.json From 1261d3e9f0659e7594027d7962da62ee493d0bfe Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 7 Aug 2018 10:25:28 -0700 Subject: [PATCH 2/2] remove locky --- .circleci/config.yml | 17 +-------- .circleci/get_workflow_name.py | 67 ---------------------------------- 2 files changed, 1 insertion(+), 83 deletions(-) delete mode 100644 .circleci/get_workflow_name.py diff --git a/.circleci/config.yml b/.circleci/config.yml index cf867c5..dd4c80c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,18 +59,7 @@ jobs: - image: 'node:6' user: node steps: &unit_tests_steps - - checkout - - run: &remove_package_lock - name: Remove package-lock.json if needed. - command: | - WORKFLOW_NAME=`python .circleci/get_workflow_name.py` - echo "Workflow name: $WORKFLOW_NAME" - if [ "$WORKFLOW_NAME" = "nightly" ]; then - echo "Nightly build detected, removing package-lock.json." - rm -f package-lock.json samples/package-lock.json - else - echo "Not a nightly build, skipping this step." - fi + - checkout - run: &npm_install_and_link name: Install and link the module command: |- @@ -97,7 +86,6 @@ jobs: user: node steps: - checkout - - run: *remove_package_lock - run: *npm_install_and_link - run: &samples_npm_install_and_link name: Link the module being tested to the samples. @@ -118,7 +106,6 @@ jobs: user: node steps: - checkout - - run: *remove_package_lock - run: *npm_install_and_link - run: name: Build documentation. @@ -129,7 +116,6 @@ jobs: user: node steps: - checkout - - run: *remove_package_lock - run: name: Decrypt credentials. command: | @@ -156,7 +142,6 @@ jobs: user: node steps: - checkout - - run: *remove_package_lock - run: name: Decrypt credentials. command: | diff --git a/.circleci/get_workflow_name.py b/.circleci/get_workflow_name.py deleted file mode 100644 index ff6b58f..0000000 --- a/.circleci/get_workflow_name.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Get workflow name for the current build using CircleCI API. -Would be great if this information is available in one of -CircleCI environment variables, but it's not there. -https://circleci.ideas.aha.io/ideas/CCI-I-295 -""" - -import json -import os -import sys -import urllib2 - - -def main(): - try: - username = os.environ['CIRCLE_PROJECT_USERNAME'] - reponame = os.environ['CIRCLE_PROJECT_REPONAME'] - build_num = os.environ['CIRCLE_BUILD_NUM'] - except: - sys.stderr.write( - 'Looks like we are not inside CircleCI container. Exiting...\n') - return 1 - - try: - request = urllib2.Request( - "https://circleci.com/api/v1.1/project/github/%s/%s/%s" % - (username, reponame, build_num), - headers={"Accept": "application/json"}) - contents = urllib2.urlopen(request).read() - except: - sys.stderr.write('Cannot query CircleCI API. Exiting...\n') - return 1 - - try: - build_info = json.loads(contents) - except: - sys.stderr.write( - 'Cannot parse JSON received from CircleCI API. Exiting...\n') - return 1 - - try: - workflow_name = build_info['workflows']['workflow_name'] - except: - sys.stderr.write( - 'Cannot get workflow name from CircleCI build info. Exiting...\n') - return 1 - - print workflow_name - return 0 - - -retval = main() -exit(retval)