diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..66d45f0 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,64 @@ +# Javascript Node CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-javascript/ for more details +# +version: 2 + +defaults: &defaults + working_directory: ~/repo + docker: + - image: circleci/node:8.9.1 + +jobs: + test: + <<: *defaults + steps: + - checkout + + - restore_cache: + keys: + - v1-dependencies- + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: npm install + - run: + name: Run tests + command: npm test + + - save_cache: + paths: + - node_modules + key: v1-dependencies- + + - persist_to_workspace: + root: ~/repo + paths: . + deploy: + <<: *defaults + steps: + - attach_workspace: + at: ~/repo + - run: + name: Authenticate with registry + command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc + - run: + name: Publish package + command: npm publish + +workflows: + version: 2 + test-deploy: + jobs: + - test: + filters: + tags: + only: /^v.*/ + - deploy: + requires: + - test + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ diff --git a/.gitignore b/.gitignore index 2ac21df..934d5e6 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ .nyc_output coverage -.topcoderrc /node_modules diff --git a/package.json b/package.json index fb7f86e..f3a1b75 100755 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "tc-submission-cli", + "name": "@topcoder/topcoder-cli", "version": "1.0.0", "description": "A CLI tool that will be used by Topcoder members to submit their solutions on challenges.", "main": "index.js", @@ -21,7 +21,7 @@ "winston": "^3.2.1" }, "bin": { - "tc-submission-cli": "bin/cli.js" + "tc": "bin/cli.js" }, "devDependencies": { "chai": "^4.2.0", diff --git a/test/common/test_codebases/rc_file_with_invalid_json_syntax/.topcoderrc b/test/common/test_codebases/rc_file_with_invalid_json_syntax/.topcoderrc new file mode 100755 index 0000000..7f6f1d4 --- /dev/null +++ b/test/common/test_codebases/rc_file_with_invalid_json_syntax/.topcoderrc @@ -0,0 +1 @@ +This is not a valid topcoderrc file! diff --git a/test/common/test_codebases/with_rc_file/.topcoderrc b/test/common/test_codebases/with_rc_file/.topcoderrc new file mode 100755 index 0000000..416b1b8 --- /dev/null +++ b/test/common/test_codebases/with_rc_file/.topcoderrc @@ -0,0 +1,8 @@ +{ + "challengeIds": [ + "30055247", + "30055217" + ], + "username": "TonyJ", + "password": "appirio123" +}