From b32bdc39173f139c82d64c807c1f228c46ed3c5b Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Fri, 14 Jun 2019 17:46:27 -0400 Subject: [PATCH 1/7] Fixed release script. Renamed version in files. (#425) --- build/ci-cd/package-release.sh | 2 +- src/content/fedramp.gov/xml/FedRAMP_HIGH-baseline_profile.xml | 2 +- src/content/fedramp.gov/xml/FedRAMP_LOW-baseline_profile.xml | 2 +- .../fedramp.gov/xml/FedRAMP_MODERATE-baseline_profile.xml | 2 +- .../rev4/xml/NIST_SP-800-53_rev4_HIGH-baseline_profile.xml | 2 +- .../rev4/xml/NIST_SP-800-53_rev4_LOW-baseline_profile.xml | 2 +- .../rev4/xml/NIST_SP-800-53_rev4_MODERATE-baseline_profile.xml | 2 +- .../nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_catalog.xml | 2 +- src/metaschema/oscal_catalog_metaschema.xml | 2 +- src/metaschema/oscal_metadata_metaschema.xml | 2 +- src/metaschema/oscal_profile_metaschema.xml | 2 +- src/metaschema/oscal_ssp_metaschema.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/ci-cd/package-release.sh b/build/ci-cd/package-release.sh index 6d6c09d7e3..0c352465ae 100644 --- a/build/ci-cd/package-release.sh +++ b/build/ci-cd/package-release.sh @@ -77,7 +77,7 @@ github-release upload \ --file "${archive_file}" \ 2>&1 | sed -e "s/access_token=[0-9a-fA-F]*/access_token=**redacted**/g" -archive_file="${working_dir}/${archive_name}.zip" +archive_file="${working_dir}/${release_name}.zip" (cd "${archive_dir}" && zip -r "${archive_file}" .) diff --git a/src/content/fedramp.gov/xml/FedRAMP_HIGH-baseline_profile.xml b/src/content/fedramp.gov/xml/FedRAMP_HIGH-baseline_profile.xml index 002931a481..b236a50dd2 100644 --- a/src/content/fedramp.gov/xml/FedRAMP_HIGH-baseline_profile.xml +++ b/src/content/fedramp.gov/xml/FedRAMP_HIGH-baseline_profile.xml @@ -5,7 +5,7 @@ FedRAMP High Baseline 2019-06-03T11:39:45.032-04:00 1.1 - 1.0-M1 + 1.0-milestone1 Author diff --git a/src/content/fedramp.gov/xml/FedRAMP_LOW-baseline_profile.xml b/src/content/fedramp.gov/xml/FedRAMP_LOW-baseline_profile.xml index 4278846cab..d3eae94b08 100644 --- a/src/content/fedramp.gov/xml/FedRAMP_LOW-baseline_profile.xml +++ b/src/content/fedramp.gov/xml/FedRAMP_LOW-baseline_profile.xml @@ -5,7 +5,7 @@ FedRAMP Low Baseline 2019-06-03T11:41:23.26-04:00 1.1 - 1.0-M1 + 1.0-milestone1 Author diff --git a/src/content/fedramp.gov/xml/FedRAMP_MODERATE-baseline_profile.xml b/src/content/fedramp.gov/xml/FedRAMP_MODERATE-baseline_profile.xml index dba2f75088..611222c18b 100644 --- a/src/content/fedramp.gov/xml/FedRAMP_MODERATE-baseline_profile.xml +++ b/src/content/fedramp.gov/xml/FedRAMP_MODERATE-baseline_profile.xml @@ -5,7 +5,7 @@ FedRAMP Moderate Baseline 2019-06-03T11:40:38.576-04:00 1.1 - 1.0-M1 + 1.0-milestone1 Author diff --git a/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_HIGH-baseline_profile.xml b/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_HIGH-baseline_profile.xml index 7cf28af0c1..97d7ec5c9e 100644 --- a/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_HIGH-baseline_profile.xml +++ b/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_HIGH-baseline_profile.xml @@ -7,7 +7,7 @@ 2019-06-05T17:42:25.71-04:00 2015-01-22 - 1.0-M1 + 1.0-milestone1 Document Creator Contact diff --git a/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_LOW-baseline_profile.xml b/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_LOW-baseline_profile.xml index ae1bf034ee..56b9055b35 100644 --- a/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_LOW-baseline_profile.xml +++ b/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_LOW-baseline_profile.xml @@ -7,7 +7,7 @@ 2019-06-05T17:40:49.331-04:00 2015-01-22 - 1.0-M1 + 1.0-milestone1 Document Creator Contact diff --git a/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_MODERATE-baseline_profile.xml b/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_MODERATE-baseline_profile.xml index 0876575537..51385aed17 100644 --- a/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_MODERATE-baseline_profile.xml +++ b/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_MODERATE-baseline_profile.xml @@ -7,7 +7,7 @@ 2019-06-05T17:41:23.252-04:00 2015-01-22 - 1.0-M1 + 1.0-milestone1 Document Creator Contact diff --git a/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_catalog.xml b/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_catalog.xml index 051e532868..b4ba97489b 100644 --- a/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_catalog.xml +++ b/src/content/nist.gov/SP800-53/rev4/xml/NIST_SP-800-53_rev4_catalog.xml @@ -9,7 +9,7 @@ 2019-06-05T17:36:38.803-04:00 2015-01-22 - 1.0-M1 + 1.0-milestone1 Assurance, computer security, FISMA, Privacy Act, Risk Management Framework, security controls, security requirements diff --git a/src/metaschema/oscal_catalog_metaschema.xml b/src/metaschema/oscal_catalog_metaschema.xml index 2ce659ad9e..f92c296a3e 100644 --- a/src/metaschema/oscal_catalog_metaschema.xml +++ b/src/metaschema/oscal_catalog_metaschema.xml @@ -10,7 +10,7 @@ root="catalog"> OSCAL Control Catalog Format - 1.0-M1 + 1.0-milestone1 oscal-catalog http://csrc.nist.gov/ns/oscal/1.0 diff --git a/src/metaschema/oscal_metadata_metaschema.xml b/src/metaschema/oscal_metadata_metaschema.xml index 44b79ef5a8..86ffad535c 100644 --- a/src/metaschema/oscal_metadata_metaschema.xml +++ b/src/metaschema/oscal_metadata_metaschema.xml @@ -10,7 +10,7 @@ root="VALIDATION_root"> OSCAL Document Metadata Description - 1.0-M1 + 1.0-milestone1 oscal-metadata http://csrc.nist.gov/ns/oscal/metadata/1.0/ diff --git a/src/metaschema/oscal_profile_metaschema.xml b/src/metaschema/oscal_profile_metaschema.xml index 33a619fb45..e7ebcaf222 100644 --- a/src/metaschema/oscal_profile_metaschema.xml +++ b/src/metaschema/oscal_profile_metaschema.xml @@ -7,7 +7,7 @@ xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0" xmlns:o="http://csrc.nist.gov/ns/oscal/1.0" root="profile"> OSCAL Profile Metaschema - 1.0-M1 + 1.0-milestone1 oscal-profile http://csrc.nist.gov/ns/oscal/1.0 diff --git a/src/metaschema/oscal_ssp_metaschema.xml b/src/metaschema/oscal_ssp_metaschema.xml index 00d3804679..c3459a0301 100644 --- a/src/metaschema/oscal_ssp_metaschema.xml +++ b/src/metaschema/oscal_ssp_metaschema.xml @@ -15,7 +15,7 @@ root="system-security-plan"> OSCAL System Security Plan (SSP) Format - 1.0-M1 + 1.0-milestone1 oscal-ssp urn:OSCAL-SSP-metaschema From 5042d8dd3fee8721e16f545269bcd1c87a83f75b Mon Sep 17 00:00:00 2001 From: david-waltermire-nist Date: Fri, 14 Jun 2019 22:31:50 -0400 Subject: [PATCH 2/7] Added new custom JSON validator. --- .circleci/config.yml | 61 +++++---- build/ci-cd/copy-and-convert-content.sh | 3 +- build/ci-cd/generate-schema.sh | 4 +- build/ci-cd/init-validate-json.sh | 45 +++++++ build/ci-cd/json-schema-schema.json | 168 ++++++++++++++++++++++++ build/ci-cd/validate-content.sh | 3 +- 6 files changed, 258 insertions(+), 26 deletions(-) create mode 100644 build/ci-cd/init-validate-json.sh create mode 100644 build/ci-cd/json-schema-schema.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c7d44ec84..f8278c0e29 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,15 @@ version: 2.1 # use CircleCI 2.1 +orbs: + maven: circleci/maven@1.0.0 references: common_environment: &common_environment environment: SAXON_VERSION: 9.9.0-1 + JSON_CLI_VERSION: 0.0.1-SNAPSHOT CICD_DIR: git-oscal/build/ci-cd OSCAL_REPO_DIR: git-oscal OSCAL_BUILD_DIR: build_artifacts + OSCAL_TOOLS_DIR: oscal_tools SCHEMATRON_HOME: git-schematron TERM: xterm working_directory: ~/oscal @@ -28,19 +32,6 @@ references: paths: - ~/jekyll-bundle commands: - install-saxon: - description: "Install Saxon-HE" - steps: - - restore_cache: - key: maven-m2 - - run: - name: Get Saxon - command: | - mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DartifactId=Saxon-HE -DgroupId=net.sf.saxon -Dversion=$SAXON_VERSION - - save_cache: - key: maven-m2 - paths: - - ~/.m2 install-schematron: description: "Install the schematron skeleton" steps: @@ -50,6 +41,34 @@ commands: git clone --depth 1 --no-checkout https://github.com/Schematron/schematron.git "$SCHEMATRON_HOME" cd "$SCHEMATRON_HOME" git checkout master -- trunk/schematron/code + install-maven-dependencies: + description: "Install Maven Dependencies" + steps: + - run: + name: Generate cache checksum + command: | + # Ensure we cache the necessary dependencies + cat "${MAVEN_TOOLS_DIR}/json-cli/pom.xml" > .maven-cache-checksum + echo "$SAXON_VERSION" >> .maven-cache-checksum + - restore_cache: + keys: + - mvn-m2-cache-V2-{{ checksum ".maven-cache-checksum" }} + - mvn-m2-cache-V2 + - run: + name: Get Saxon-HE + command: | + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DartifactId=Saxon-HE -DgroupId=net.sf.saxon -Dversion=$SAXON_VERSION + - run: + name: Get JSON Validation CLI and build it + command: | + git clone --depth 1 https://github.com/usnistgov/oscal-tools.git "${MAVEN_TOOLS_DIR}" + cd "${MAVEN_TOOLS_DIR}/json-cli" + mvn dependency:go-offline + mvn install + - save_cache: + paths: + - ~/.m2 + key: mvn-m2-cache-V2-{{ checksum ".maven-cache-checksum" }} install-maven: description: "Installs Maven" steps: @@ -169,7 +188,7 @@ jobs: # a collection of - *attach_build_workspace - check-skip-build - install-xmllint - - install-saxon + - install-maven-dependencies - install-schematron - run: name: Validate metaschema instances @@ -186,8 +205,7 @@ jobs: # a collection of - *checkout - *attach_build_workspace - check-skip-build - - install-saxon - - install-ajv + - install-maven-dependencies - run: name: Generate OSCAL schemas command: | @@ -204,7 +222,7 @@ jobs: # a collection of - *checkout - *attach_build_workspace - check-skip-build - - install-saxon + - install-maven-dependencies - run: name: Generate OSCAL schemas command: | @@ -221,10 +239,9 @@ jobs: # a collection of - *checkout - *attach_build_workspace - check-skip-build - - install-saxon + - install-maven-dependencies - install-jq - install-prettyjson - - install-ajv - run: name: Generate OSCAL converters command: | @@ -252,7 +269,7 @@ jobs: # a collection of - *attach_build_workspace - check-skip-build - install-xmllint - - install-ajv + - install-maven-dependencies - run: name: Validate content instances command: | @@ -264,7 +281,7 @@ jobs: # a collection of - *attach_build_workspace - check-skip-build - install-maven - - install-saxon + - install-maven-dependencies - install-lxml - install-xmllint - run: @@ -278,7 +295,7 @@ jobs: # a collection of - *checkout - *attach_build_workspace - check-skip-build - - install-saxon + - install-maven-dependencies - run: name: Generate schema documentation command: | diff --git a/build/ci-cd/copy-and-convert-content.sh b/build/ci-cd/copy-and-convert-content.sh index 3e9b23d28d..56ee43d938 100644 --- a/build/ci-cd/copy-and-convert-content.sh +++ b/build/ci-cd/copy-and-convert-content.sh @@ -6,6 +6,7 @@ if [[ -z "$OSCALDIR" ]]; then fi source $OSCALDIR/build/ci-cd/saxon-init.sh +source $OSCALDIR/build/ci-cd/init-validate-json.sh if [ -z "$1" ]; then working_dir="$OSCALDIR" @@ -63,7 +64,7 @@ while IFS="|" read path format model converttoformats || [[ -n "$path" ]]; do # validate generated file schema="$working_dir/json/schema/oscal_${model}_schema.json" - ajv validate -s "$schema" -d "$dest" --extend-refs=true --verbose + validate_json "$schema" "$dest" # produce pretty JSON dest_pretty="$working_dir/${newpath}.${altformat}" diff --git a/build/ci-cd/generate-schema.sh b/build/ci-cd/generate-schema.sh index 1931bc08f8..b28b6b6dbb 100644 --- a/build/ci-cd/generate-schema.sh +++ b/build/ci-cd/generate-schema.sh @@ -4,8 +4,8 @@ if [[ -z "$OSCALDIR" ]]; then DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" source "$DIR/common-environment.sh" fi - source $OSCALDIR/build/ci-cd/saxon-init.sh +source $OSCALDIR/build/ci-cd/init-validate-json.sh if [ -z "$1" ]; then working_dir="$OSCALDIR" @@ -75,7 +75,7 @@ while IFS="|" read path gen_schema gen_converter gen_docs || [[ -n "$path" ]]; d # xml) # TODO: Add support for XML schema validation json) - ajv compile -s "$schema" --extend-refs=true --verbose + validate_json "$OSCALDIR/build/ci-cd/json-schema-schema.json" "$schema" cmd_exitcode=$? ;; *) diff --git a/build/ci-cd/init-validate-json.sh b/build/ci-cd/init-validate-json.sh new file mode 100644 index 0000000000..feb917b129 --- /dev/null +++ b/build/ci-cd/init-validate-json.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +if [[ -z "$OSCALDIR" ]]; then + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + source "$DIR/common-environment.sh" +fi + +if [[ -z "$JSON_CLI_HOME" ]]; then + if [[ -z "$JSON_CLI_VERSION" ]]; then + echo "${P_ERROR}JSON_CLI_VERSION is not set or is empty.${P_END} ${P_INFO}Please set JSON_CLI_VERSION to indicate the library version${P_END}" + fi + JSON_CLI_HOME=~/.m2/repository/gov/nist/oscal/json-cli/${JSON_CLI_VERSION} +fi + +# ( set -o posix ; set ) + +validate_json() { + local json_schema="$1"; shift + local json_file="$1"; shift + local extra_params=($@) + + local classpath=$(JARS=("$JSON_CLI_HOME"/*.jar); IFS=:; echo "${JARS[*]}") + + set -- + + if [ -z "$json_schema" ]; then + echo "${P_ERROR}The JSON schema must be provided as the first argument.${P_END}" + else + set -- "$@" "-s" "${json_schema}" + fi + + if [ -z "$json_file" ]; then + echo "${P_ERROR}The JSON file must be provided as the second argument.${P_END}" + else + set -- "$@" "-v" "${json_file}" + fi + + java -cp "$classpath" gov.nist.oscal.json.JsonCLI "$@" "${extra_params[@]}" + + if [ "$?" -ne 0 ]; then + echo "${P_ERROR}Error running JsonCLI.${P_END}" + return 3 + fi + return 0 +} diff --git a/build/ci-cd/json-schema-schema.json b/build/ci-cd/json-schema-schema.json new file mode 100644 index 0000000000..85079d89cd --- /dev/null +++ b/build/ci-cd/json-schema-schema.json @@ -0,0 +1,168 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true +} diff --git a/build/ci-cd/validate-content.sh b/build/ci-cd/validate-content.sh index 7b484f0460..f801c9e61d 100644 --- a/build/ci-cd/validate-content.sh +++ b/build/ci-cd/validate-content.sh @@ -4,6 +4,7 @@ if [[ -z "$OSCALDIR" ]]; then DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" source "$DIR/common-environment.sh" fi +source $OSCALDIR/build/ci-cd/init-validate-json.sh if [ -z "$1" ]; then working_dir="$OSCALDIR" @@ -44,7 +45,7 @@ while IFS="|" read path format model converttoformats || [ -n "$path" ]; do ;; json) schema="$working_dir/json/schema/oscal_${model}_schema.json" - ajv validate -s "$schema" -d "$file" --extend-refs=true --verbose + validate_json "$schema" "$file" cmd_exitcode=$? if [ $cmd_exitcode -ne 0 ]; then echo "${P_ERROR}JSON schema validation failed for '$file'.${P_END}" From 4b78457258ec9c7b7c1d0815ab17af610402c996 Mon Sep 17 00:00:00 2001 From: david-waltermire-nist Date: Fri, 14 Jun 2019 22:34:19 -0400 Subject: [PATCH 3/7] Fixed CI config. --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f8278c0e29..88a8672cbf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,4 @@ version: 2.1 # use CircleCI 2.1 -orbs: - maven: circleci/maven@1.0.0 references: common_environment: &common_environment environment: From 010d1cc04c29e0cfd2228fd5321adf166c4d2256 Mon Sep 17 00:00:00 2001 From: david-waltermire-nist Date: Fri, 14 Jun 2019 22:36:25 -0400 Subject: [PATCH 4/7] Fixed CI config. --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 88a8672cbf..c64aadc6e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ references: CICD_DIR: git-oscal/build/ci-cd OSCAL_REPO_DIR: git-oscal OSCAL_BUILD_DIR: build_artifacts - OSCAL_TOOLS_DIR: oscal_tools + _OSCALTOOLS_DIR: oscal_tools SCHEMATRON_HOME: git-schematron TERM: xterm working_directory: ~/oscal @@ -46,7 +46,7 @@ commands: name: Generate cache checksum command: | # Ensure we cache the necessary dependencies - cat "${MAVEN_TOOLS_DIR}/json-cli/pom.xml" > .maven-cache-checksum + cat "${OSCALTOOLS_DIR}/json-cli/pom.xml" > .maven-cache-checksum echo "$SAXON_VERSION" >> .maven-cache-checksum - restore_cache: keys: @@ -59,8 +59,8 @@ commands: - run: name: Get JSON Validation CLI and build it command: | - git clone --depth 1 https://github.com/usnistgov/oscal-tools.git "${MAVEN_TOOLS_DIR}" - cd "${MAVEN_TOOLS_DIR}/json-cli" + git clone --depth 1 https://github.com/usnistgov/oscal-tools.git "${OSCALTOOLS_DIR}" + cd "${OSCALTOOLS_DIR}/json-cli" mvn dependency:go-offline mvn install - save_cache: From 9f36a9679fc798b7fa23d1922f010dc69e01324b Mon Sep 17 00:00:00 2001 From: david-waltermire-nist Date: Fri, 14 Jun 2019 22:39:01 -0400 Subject: [PATCH 5/7] Another CI fix. --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c64aadc6e3..fa4b51ffb0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ references: CICD_DIR: git-oscal/build/ci-cd OSCAL_REPO_DIR: git-oscal OSCAL_BUILD_DIR: build_artifacts - _OSCALTOOLS_DIR: oscal_tools + OSCAL_TOOLS_DIR: oscal_tools SCHEMATRON_HOME: git-schematron TERM: xterm working_directory: ~/oscal @@ -46,7 +46,7 @@ commands: name: Generate cache checksum command: | # Ensure we cache the necessary dependencies - cat "${OSCALTOOLS_DIR}/json-cli/pom.xml" > .maven-cache-checksum + cat "${OSCAL_TOOLS_DIR}/json-cli/pom.xml" > .maven-cache-checksum echo "$SAXON_VERSION" >> .maven-cache-checksum - restore_cache: keys: @@ -59,8 +59,8 @@ commands: - run: name: Get JSON Validation CLI and build it command: | - git clone --depth 1 https://github.com/usnistgov/oscal-tools.git "${OSCALTOOLS_DIR}" - cd "${OSCALTOOLS_DIR}/json-cli" + git clone --depth 1 https://github.com/usnistgov/oscal-tools.git "${OSCAL_TOOLS_DIR}" + cd "${OSCAL_TOOLS_DIR}/json-cli" mvn dependency:go-offline mvn install - save_cache: From f0649ddb3de55102e76b9cde53c75d4c3a10d665 Mon Sep 17 00:00:00 2001 From: david-waltermire-nist Date: Fri, 14 Jun 2019 22:42:11 -0400 Subject: [PATCH 6/7] Another CI fix. --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa4b51ffb0..39890667af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,6 +42,10 @@ commands: install-maven-dependencies: description: "Install Maven Dependencies" steps: + - run: + name: Get OSCAL Tools + command: | + git clone --depth 1 https://github.com/usnistgov/oscal-tools.git "${OSCAL_TOOLS_DIR}" - run: name: Generate cache checksum command: | @@ -57,7 +61,7 @@ commands: command: | mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DartifactId=Saxon-HE -DgroupId=net.sf.saxon -Dversion=$SAXON_VERSION - run: - name: Get JSON Validation CLI and build it + name: Build JSON Validation CLI command: | git clone --depth 1 https://github.com/usnistgov/oscal-tools.git "${OSCAL_TOOLS_DIR}" cd "${OSCAL_TOOLS_DIR}/json-cli" @@ -165,6 +169,7 @@ jobs: # a collection of steps: - checkout - run: + name: Check if skip build command: | mkdir -p "$OSCAL_BUILD_DIR/state" COMMIT_MSG=$(git log --format=oneline -n 1 $CIRCLE_SHA1) From 8dd2f1d1f2e46ff2d39c4de6ba7891619c5e8425 Mon Sep 17 00:00:00 2001 From: david-waltermire-nist Date: Fri, 14 Jun 2019 22:44:29 -0400 Subject: [PATCH 7/7] And one more. --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 39890667af..256921de07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,6 @@ commands: - run: name: Build JSON Validation CLI command: | - git clone --depth 1 https://github.com/usnistgov/oscal-tools.git "${OSCAL_TOOLS_DIR}" cd "${OSCAL_TOOLS_DIR}/json-cli" mvn dependency:go-offline mvn install