Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of Metaschema M4 features into OSCAL repository #758

Merged
merged 131 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
e07720b
merging in lastest from upstream
david-waltermire Sep 17, 2020
fdf7cc4
Integrated metaschema validation and schema generation into CI/CD
david-waltermire Sep 17, 2020
07d877a
updating to latest metaschema submodule
david-waltermire Oct 7, 2020
04a6c00
WIP metaschema transition
brian-ruf Oct 8, 2020
49757b8
WIP
brian-ruf Oct 14, 2020
02aa1bf
More work on SSP metaschema refactoring; updating ci-cd metaschema co…
david-waltermire Oct 14, 2020
fb99b60
metaschema M4 updates. No errors.
brian-ruf Oct 14, 2020
1f1eeaf
updating to latest metaschema code
david-waltermire Oct 19, 2020
0f3021e
futher work on metaschema cleanup. The SSP metaschema is now free of …
david-waltermire Oct 19, 2020
267c447
Changed relevant-evidence group name (#775)
brian-ruf Oct 21, 2020
ad84952
Adjusting metaschema module update behavior
david-waltermire Oct 20, 2020
574d0d1
Addessed missing JSON value keys, with some question placeholders; an…
david-waltermire Oct 22, 2020
b7e8bf2
Cleanup of allowed values and other constraints. Also cleanup of comp…
david-waltermire Oct 23, 2020
b0927c8
Reviewed all uses of 'id' and '*-id' to make sure the name is correct…
david-waltermire Nov 3, 2020
1f21c45
Fixed missing json-value-key or made as-type='empty', which resolves …
david-waltermire Nov 3, 2020
a4b687e
Made asset-id optional, which resolves #745
david-waltermire Nov 3, 2020
9a1b7f7
updating to latest metaschema
david-waltermire Nov 3, 2020
ee5995a
Some progress on addressing issue #777.
david-waltermire Nov 4, 2020
819776c
Completed edits to resolve #777.
david-waltermire Nov 4, 2020
8a3abda
adding missing entity definition file
david-waltermire Nov 4, 2020
5e2b690
fixed xmlint validation errors
david-waltermire Nov 13, 2020
796c9ab
remove unnecessary top-level in assessment common
brian-ruf Oct 21, 2020
95a7bea
remove unnecessary top-level in assessment common
brian-ruf Oct 21, 2020
367f905
Updates consistent with issue #776
brian-ruf Nov 12, 2020
cf402f9
clarifications on ID/UUID usage and OSCAL file update requirements
brian-ruf Nov 12, 2020
5fc4f0b
Validation Modeling content and an additional tweak to mailing list u…
brian-ruf Nov 13, 2020
447af63
added content on defiend identifiers
brian-ruf Nov 13, 2020
125d09c
readme updates, including mailing list updates, minor tweaks, and sch…
brian-ruf Nov 13, 2020
1f17cc0
added schema instructions. editorial tweaks.
brian-ruf Nov 13, 2020
7241b72
updated model documentation generation to M4
david-waltermire Nov 18, 2020
5ee4027
fixed generated documentation paths
david-waltermire Nov 18, 2020
20f89a1
Addressed group naming resolving #780
david-waltermire Nov 19, 2020
a977703
Fixed metaschema validation error for missing 'objectives'.
david-waltermire Nov 19, 2020
572b41b
additional group changes based on discussion with @brianrufgsa
david-waltermire Nov 20, 2020
8d18d86
changed objectives to objective based on conversation with @brianrufgsa
david-waltermire Nov 20, 2020
37341cf
Work to localize some assembly, field, and flag definitions that are …
david-waltermire Nov 24, 2020
f12d99a
Addressed a number of open questions related to the models
david-waltermire Nov 24, 2020
9c31107
Pointing Hugo page stubs at included resources (partials)
wendellpiez Nov 19, 2020
d7c514d
CSS fitting
wendellpiez Nov 23, 2020
9dc25fe
More improvements to maps, XML docs, Hugo setup
wendellpiez Nov 25, 2020
ae68302
More adjustments to docs configuration and styling
wendellpiez Nov 30, 2020
1a70979
updating to latest metaschema toolchain
david-waltermire Dec 1, 2020
4c5b5a5
removing public directory
david-waltermire Dec 2, 2020
5d4a180
Modifying configuration of JSON Schema docs pages (toc)
wendellpiez Dec 3, 2020
d4ea79d
minor doc style tweeks
david-waltermire Dec 3, 2020
c8467a2
removed extra junk files
david-waltermire Dec 3, 2020
936d733
Updated docker build to use a newer version of hugo
david-waltermire Dec 3, 2020
23432d4
More CSS for better schema docs
wendellpiez Dec 4, 2020
c82c7f3
More refinements to maps mainly
wendellpiez Dec 5, 2020
6a00c1c
more same
wendellpiez Dec 5, 2020
20ae02e
Fine points in CSS
wendellpiez Dec 5, 2020
0cae75e
Fine tuning
wendellpiez Dec 6, 2020
b597199
Further CSS adjustments for maps
wendellpiez Dec 7, 2020
2f7b629
Pulling out list-style-position on summary, for consistency, until it…
wendellpiez Dec 7, 2020
eba7e92
updating to latest metaschema
david-waltermire Dec 10, 2020
1d0c5ea
SCSS to go with usnistgov/metaschema#96
wendellpiez Dec 11, 2020
2aa5a16
upgrading to latest metaschema toolchain to fix style issues
david-waltermire Dec 12, 2020
f06d4d3
Fixed typo in SSP model - same typo - multiple diagrams
brian-ruf Dec 7, 2020
02543a2
UUID usage clarifications
brian-ruf Dec 9, 2020
e16e3fb
WIP: refactoring assessment-activities
brian-ruf Nov 25, 2020
451865c
WIP: more changes to assessment assemblies
brian-ruf Nov 26, 2020
6d08347
WIP: Allowed values.
brian-ruf Dec 5, 2020
41ca67f
WIP: Allowed Values Work
brian-ruf Dec 3, 2020
9c34ac0
WIP: metaschema implementation layer updates
brian-ruf Dec 9, 2020
80ce6e3
WIP: Implementaiton layer work
brian-ruf Dec 9, 2020
f712156
Implementation Layer Allowed Values
brian-ruf Dec 11, 2020
18e9ace
Updated Implementation Layer Allowed Values - Better aligned SSP/comp…
brian-ruf Dec 11, 2020
8884775
Implementaiton Layer Component Allowed Value Work
brian-ruf Dec 11, 2020
4347442
refactoring assessment models; start of changelog
david-waltermire Dec 1, 2020
28ab77a
more refinements to the assessment models
david-waltermire Dec 3, 2020
f2fcedb
latest release notes
david-waltermire Dec 9, 2020
4133d63
refactored activities and tasks in assessment models. Also implemente…
david-waltermire Dec 9, 2020
7534ef5
adjusted missing data types. refactored observation/risk/finding models
david-waltermire Dec 9, 2020
c80bede
More refactoring based on discussion with @brianrufgsa
david-waltermire Dec 12, 2020
72b8d6b
cleanup
david-waltermire Dec 12, 2020
fbf4053
progress on change through catalog and into profile
david-waltermire Dec 12, 2020
eea986f
compled change log through profile model
david-waltermire Dec 12, 2020
74b4ed0
SCSS changes and improvements; tailoring schema home markdown pages
wendellpiez Dec 13, 2020
53a8e04
upgrading to latest metaschema toolchain
david-waltermire Dec 13, 2020
1c36630
Addressing feedback from PR #797
david-waltermire Dec 13, 2020
c04770b
completed review of format changes for the SSP model
david-waltermire Dec 13, 2020
9a3df68
Enhancements to schema docs displays
wendellpiez Dec 13, 2020
f4c749f
upgrading to latest metaschema toolchain
david-waltermire Dec 14, 2020
bc51adc
updating to latest metaschema toolchain
david-waltermire Dec 14, 2020
d3345e7
fixed broken links
david-waltermire Dec 14, 2020
3c488e0
completed release notes up through the implementation layer
david-waltermire Dec 14, 2020
4c40215
fixed inconsistencies in changelog. Refactored PO&M model to sync wit…
david-waltermire Dec 14, 2020
7e09620
cleanup of asessment models. fixed bad paths for component-type
david-waltermire Dec 15, 2020
4c6462e
Fixing missing and inconsistent release notes.
david-waltermire Dec 15, 2020
99466ae
Modified to produce `link` as valid to RC1 model in profile resolution
wendellpiez Dec 15, 2020
19f2354
Examples updated; out of date resolution results removed.
wendellpiez Dec 15, 2020
9a04f00
First cut at OSCAL M3-RC1 XML content converter
wendellpiez Dec 15, 2020
8e0c71c
Now reallocating 'implemented-requirement//description' into 'this-sy…
wendellpiez Dec 15, 2020
9dc3e24
updating to latest metaschema toolchain
david-waltermire Dec 15, 2020
21e10b9
migrated tutorial and other content links to use a pointer to the OSC…
david-waltermire Dec 15, 2020
8b890e0
fixing broken links in pages content
david-waltermire Dec 15, 2020
685ff6c
updating to latest metaschema toolchain
david-waltermire Dec 15, 2020
dcee6fe
updating to latest metaschema toolchain
david-waltermire Dec 16, 2020
40f6953
Fixing error handling in bash scripts
david-waltermire Dec 16, 2020
ce6e424
minor change to SSP control-implementation ordering
david-waltermire Dec 16, 2020
02d98a1
refactoring based on test data
david-waltermire Dec 16, 2020
4187726
WIP: Allowed Values in Assessment Layers
brian-ruf Dec 16, 2020
5e7f30e
WIP: assessment layer allowed values
brian-ruf Dec 16, 2020
9da6148
WIP: assessment layer allowed values 2
brian-ruf Dec 16, 2020
e62a6b7
WIP: assessment layer allowed values 3
brian-ruf Dec 16, 2020
1bd2097
tweeks based on review by brianrufgsa
david-waltermire Dec 16, 2020
ec12537
WIP: Assessment Layers Tweaks
brian-ruf Dec 17, 2020
84f0ebd
ongoing refactoring of assessement models
david-waltermire Dec 17, 2020
896ccb9
fixing round-trip script to work in oscal-content repo
david-waltermire Dec 17, 2020
335a655
Adjusted 'prose' cardinality in control-common metaschema
wendellpiez Dec 17, 2020
086991a
minor refactoring based on SSP review with @brianrufgsa
david-waltermire Dec 17, 2020
af77341
completed refactoring of risk structures. Also checked for missing as…
david-waltermire Dec 18, 2020
9d714a0
WIP: Additional allowed values
brian-ruf Dec 17, 2020
9451578
WIP: Additional added value tweaks
brian-ruf Dec 17, 2020
40051fc
Modified RC1 update converter to refresh time stamp; added catalog li…
wendellpiez Dec 18, 2020
f619482
Added logged-by to assessment and risk logs
david-waltermire Dec 18, 2020
de7c82b
changed metaschema versions to 1.0.0-rc1
david-waltermire Dec 18, 2020
dce6171
replaced the risk-metrics structure with a more general characterizat…
david-waltermire Dec 20, 2020
ec110ac
added RC1 to roadmap
david-waltermire Dec 20, 2020
1f8b51e
updating to latest metaschema toolchain
david-waltermire Dec 20, 2020
3e8fe48
Updating to latest metaschema toolchain
david-waltermire Dec 20, 2020
372038e
Updating documentation. added support for anchor.js. Minor data type …
david-waltermire Dec 21, 2020
2c61e7c
updating to latest metaschema toolchain
david-waltermire Dec 21, 2020
9368a43
adding the latest build artifacts
david-waltermire Dec 21, 2020
2418de3
fixed invalid unit test source
david-waltermire Dec 21, 2020
18d4be0
fixing profile unit tests
david-waltermire Dec 21, 2020
513aa3e
Updating to latest metaschema toolchain to fix broken links in genera…
david-waltermire Dec 21, 2020
95eadfa
removing profile resolution unit tests from build
david-waltermire Dec 21, 2020
bc66cc0
fixed a broken link in the catalog tutorial
david-waltermire Dec 21, 2020
e852bd3
updating examples to new rc1 syntax.
david-waltermire Dec 21, 2020
1917585
updating one more example
david-waltermire Dec 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 13 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,6 @@ commands:
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: Build JSON Validation CLI
command: |
# update maven version
cd /opt
sudo wget --no-check-certificate "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
sudo tar -xvzf "apache-maven-${MAVEN_VERSION}-bin.tar.gz"
sudo mv "apache-maven-${MAVEN_VERSION}" maven
export M2_HOME=/opt/maven
export PATH=${M2_HOME}/bin:${PATH}
cd -
# now build
cd "${OSCAL_TOOLS_DIR}/json-cli"
/opt/maven/bin/mvn dependency:go-offline
/opt/maven/bin/mvn install
- save_cache:
paths:
- ~/.m2
Expand Down Expand Up @@ -130,13 +115,13 @@ commands:
name: Get xmllint
command: |
sudo apt-get install libxml2-utils
#install-npm-ajv:
# description: "Install ajv"
# steps:
# - run:
# name: Get ajv
# command: |
# sudo npm install -g ajv-cli
install-npm-ajv:
description: "Install ajv"
steps:
- run:
name: Get ajv
command: |
sudo npm install -g ajv-cli
install-npm-json-diff:
description: "Install json-diff"
steps:
Expand Down Expand Up @@ -259,6 +244,7 @@ jobs: # a collection of
- install-maven-dependencies
- apt-update
- install-apt-xmllint
- install-npm-ajv
- run:
name: Generate OSCAL schemas
command: |
Expand Down Expand Up @@ -453,15 +439,16 @@ jobs: # a collection of
- check-skip-build
- apt-update
- install-apt-xmllint
- install-npm-ajv
- install-maven-dependencies
- run:
name: Run Content Unit Tests
command: |
bash "$CICD_DIR/run-unittests.sh" -w "$OSCAL_BUILD_DIR"
- run:
name: Run Profile Resolution Unit Tests
command: |
bash "$CICD_DIR/test-profile-resolution.sh" -w "$OSCAL_BUILD_DIR"
# - run:
# name: Run Profile Resolution Unit Tests
# command: |
# bash "$CICD_DIR/test-profile-resolution.sh" -w "$OSCAL_BUILD_DIR"
workflows:
version: 2
build:
Expand Down
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
[submodule "build/metaschema"]
path = build/metaschema
url = https://github.com/usnistgov/metaschema.git
branch = master
branch = metaschema-m4-integration
update = rebase
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ The core OSCAL project team regularly reviews the open issues, prioritizes their

There are two mailing lists for the project:

- *[email protected]* for communication among parties interested in contributing to the development of OSCAL or exchanging ideas. Subscribe by sending an email to [oscal-dev-join@nist.gov](mailto:oscal-dev-join@nist.gov). To unsubscribe send an email to [oscal-dev-leave@nist.gov](mailto:oscal-dev-leave@nist.gov).
- *[email protected]* for low-frequency updates on the status of the OSCAL project. Subscribe by sending an email to [oscal-updates-join@nist.gov](mailto:oscal-updates-join@nist.gov). To unsubscribe send an email to [oscal-updates-leave@nist.gov](mailto:oscal-updates-leave@nist.gov).
- *[email protected]* for communication among parties interested in contributing to the development of OSCAL or exchanging ideas. Subscribe by sending an email to [oscal-dev+subscribe@list.nist.gov](mailto:oscal-dev+subscribe@list.nist.gov). To unsubscribe send an email to [oscal-dev+unsubscribe@list.nist.gov](mailto:oscal-dev+unsubscribe@list.nist.gov).
- *oscal-updates@list.nist.gov* for low-frequency updates on the status of the OSCAL project. Subscribe by sending an email to [oscal-updates+subscribe@list.nist.gov](mailto:oscal-updates+subscribe@list.nist.gov). To unsubscribe send an email to [oscal-updates+unsubscribe@list.nist.gov](mailto:oscal-updates+unsubscribe@list.nist.gov).

## Contributing to the OSCAL repository

Expand All @@ -56,7 +56,7 @@ This repository consists of the following directories and files pertaining to th
- [docs](docs): Stores sources for the [OSCAL website](https://pages.nist.gov/OSCAL).
- [content](content): This directory once stored XML, JSON, and YAML content examples. These examples have been moved to the OSCAL content GitHub [repository](https://github.com/usnistgov/oscal-content/tree/master).
- [build](build): Contains a collection of scripts, eXtensible Stylesheet Language Transformations (XSLTs), and other artifacts used to support this repository's continuous integration and continuous deployment (CI/CD) processes.
- [src](src): This directory once stored source artifacts used to produce the XML, JSON, and YAML resources that were provided in this repository. These resources have been moved to the OSCAL content GitHub [repository](https://github.com/usnistgov/oscal-content/tree/master/src).
- [src](src): This includes the resources used by the NIST OSCAL Team to manage OSCAL development, including the metaschema files used to maintain the OSCAL models across all supported formats. This directory once stored source artifacts used to produce the XML, JSON, and YAML resources that were provided in this repository. These resources have been moved to the OSCAL content GitHub [repository](https://github.com/usnistgov/oscal-content/tree/master/src).
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md): This file contains a code of conduct for OSCAL project contributors.
- [CONTRIBUTING.md](CONTRIBUTING.md): This file is for potential contributors to the OSCAL project. It provides basic information on the OSCAL project, describes the main ways people can make contributions, explains how to report issues with OSCAL, and lists pointers to additional sources of information. It also has instructions on establishing a development environment for contributing to the OSCAL project and using GitHub project cards to track development sprints.
- [LICENSE.md](LICENSE.md): This file contains license and copyright information for the files in the OSCAL GitHub repository.
Expand Down
6 changes: 5 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
FROM ubuntu:18.04

ARG saxonversion
ARG hugoversion

RUN apt-get update && apt-get install -y apt-utils libxml2-utils jq maven hugo nodejs npm build-essential python-pip git && apt-get clean
RUN apt-get update && apt-get install -y wget apt-utils libxml2-utils jq maven nodejs npm build-essential python-pip git && apt-get clean
RUN npm install -g prettyjson markdown-link-check json-diff ajv-cli
RUN pip install lxml

Expand All @@ -12,6 +13,9 @@ RUN pip install lxml

RUN mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DartifactId=Saxon-HE -DgroupId=net.sf.saxon -Dversion=${saxonversion}

RUN wget https://github.com/gohugoio/hugo/releases/download/v${hugoversion}/hugo_extended_${hugoversion}_Linux-64bit.deb
RUN dpkg -i hugo_extended_${hugoversion}_Linux-64bit.deb

#RUN chown -R user:user /home/user

VOLUME ["/oscal"]
Expand Down
56 changes: 30 additions & 26 deletions build/ci-cd/copy-and-convert-content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,41 @@ Usage: $0 [options]
EOF
}

OPTS=`getopt -o w:o:c:a:vh --long resolve-profiles,working-dir:,artifact-dir:,oscal-dir:,config-file:,help -n "$0" -- "$@"`
OPTS=`getopt -o a:o:w:c:hv --long resolve-profiles,artifact-dir:,oscal-dir:,working-dir:,config-file:,help -n "$0" -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; usage ; exit 1 ; fi

# Process arguments
eval set -- "$OPTS"
while [ $# -gt 0 ]; do
arg="$1"
case "$arg" in
-w|--working-dir)
WORKING_DIR="$(realpath "$2")"
shift # past path
;;
--resolve-profiles)
RESOLVE_PROFILES=true
shift # past path
;;
-a|--artifact-dir)
ARTIFACT_DIR="$(realpath "$2")"
shift # past path
;;
-o|--oscal-dir)
OSCAL_DIR="$(realpath "$2")"
shift # past path
;;
-c|--config-file)
CONFIG_FILE="$(realpath "$2")"
-w|--working-dir)
WORKING_DIR="$(realpath "$2")"
shift # past path
;;
-a|--artifact-dir)
ARTIFACT_DIR="$(realpath "$2")"
-c|--config-file)
CONFIG_FILE="$(realpath "$2")"
shift # past path
;;
-v)
VERBOSE=true
;;
-h|--help)
usage
exit 0
;;
-v)
VERBOSE=true
;;
--) # end of options
shift
break;
Expand Down Expand Up @@ -95,7 +95,8 @@ CATALOG_SCHEMA="$(get_abs_path "${OSCAL_DIR}/xml/schema/oscal_catalog_schema.xsd

# check for perl
result=$(which perl 2>&1)
if [ $? -ne 0 ]; then
cmd_exitcode=$?
if [ $cmd_exitcode != 0 ]; then
echo -e "${P_ERROR}Perl is not installed. Perl is needed by this script.${P_END}"
exit 1
fi
Expand Down Expand Up @@ -169,7 +170,8 @@ post_process_content() {
echo -e "${P_INFO}Producing pretty JSON '${P_END}${target_file_pretty_relative}${P_INFO}'.${P_END}"
fi
result=$(jq . "$target_file" > "$target_file_pretty" 2>&1)
if [ $? -ne 0 ]; then
cmd_exitcode=$?
if [ $cmd_exitcode != 0 ]; then
echo -e "${P_ERROR}${result}${P_END}"
echo -e "${P_ERROR}Unable to execute jq on '${P_END}${target_file_pretty_relative}${P_ERROR}'.${P_END}"
return 1;
Expand All @@ -179,7 +181,8 @@ post_process_content() {
perl -pi -e 's,\r,,g' "$target_file_pretty"

result=$(validate_content "$target_file_pretty" "json" "$model" "$oscal_dir")
if [ $? -ne 0 ]; then
cmd_exitcode=$?
if [ $cmd_exitcode != 0 ]; then
echo -e "${P_ERROR}${result}${P_END}"
echo -e "${P_ERROR}Unable to validate content '${P_END}${target_file_pretty_relative}${P_ERROR}'.${P_END}"
return 1;
Expand Down Expand Up @@ -290,7 +293,7 @@ copy_or_convert_content() {
fi
result=$(cp "$source_file" "$target_file" 2>&1)
cmd_exitcode=$?
if [ $cmd_exitcode -ne 0 ]; then
if [ $cmd_exitcode != 0 ]; then
echo -e "${P_ERROR}${result}${P_END}"
echo -e "${P_ERROR}Unable to copy '${P_END}${source_file_relative}${P_ERROR}' to '${P_END}${target_file_relative}${P_ERROR}'.${P_END}"
return 1;
Expand All @@ -303,11 +306,11 @@ copy_or_convert_content() {
fi

result=$(convert_to_format_and_validate "$source_file" "$target_file" "$source_format" "$target_format" "$model" "$oscal_dir")
cmd_exitcode=$?
if [ -n "$result" ]; then
echo -e "${result}"
fi
cmd_exitcode=$?
if [ $cmd_exitcode -ne 0 ]; then
if [ $cmd_exitcode != 0 ]; then
return 1;
else
echo -e "${P_OK}Converted ${source_format^^} ${model} '${P_END}${source_file_relative}${P_OK}' to ${target_format^^} as '${P_END}${target_file_relative}${P_OK}'.${P_END}"
Expand All @@ -319,10 +322,10 @@ copy_or_convert_content() {
echo -e "${P_INFO}Post processing ${target_format^^} content '${P_END}${target_file_relative}${P_INFO}'.${P_END}"
fi
result=$(post_process_content $source_format $target_format $target_file $working_dir $oscal_dir)
cmd_exitcode=$?
if [ -n "$result" ]; then
echo -e "${result}"
fi
cmd_exitcode=$?
if [ $cmd_exitcode != 0 ]; then
return 1;
fi
Expand All @@ -341,7 +344,7 @@ copy_or_convert_content() {

result=$(xsl_transform "${PROFILE_RESOLVER}" "$source_file" "${resolved_profile}" 2>&1)
cmd_exitcode=$?
if [ $cmd_exitcode -ne 0 ]; then
if [ $cmd_exitcode != 0 ]; then
if [ -n "$result" ]; then
echo -e "${P_ERROR}${result}${P_END}"
fi
Expand All @@ -350,7 +353,8 @@ copy_or_convert_content() {
fi

result=$(validate_xml "$CATALOG_SCHEMA" "${resolved_profile}")
if [ $cmd_exitcode -ne 0 ]; then
cmd_exitcode=$?
if [ $cmd_exitcode != 0 ]; then
if [ -n "$result" ]; then
echo -e "${P_ERROR}${result}${P_END}"
fi
Expand All @@ -366,10 +370,10 @@ copy_or_convert_content() {
echo -e "${P_INFO}Converting resolved profile '${P_END}${resolved_profile}${P_INFO}' to JSON.${P_END}"
fi
result="$(copy_or_convert_content "$source_dir" "$resolved_profile" "$working_dir" $src_format "catalog" $target_format "$working_dir" "$oscal_dir")"
cmd_exitcode=$?
if [ -n "$result" ]; then
echo -e "${result}"
fi
cmd_exitcode=$?
if [ $cmd_exitcode != 0 ]; then
return 1;
fi
Expand All @@ -392,7 +396,7 @@ process_paths() {
# printf 'models: %s\n' "${models[@]}"
# printf 'converttoformats: %s\n' "${conversion_formats[@]}"

local cmd_exitcode=0;
local exitcode=0;
#shopt -s nullglob
#shopt -s globstar

Expand All @@ -410,10 +414,10 @@ process_paths() {
# printf 'converttoformats: %s\n' "${converttoformats[@]}"

result="$(copy_or_convert_content "$ARTIFACT_DIR" "$src_file" "${ARTIFACT_DIR}/src" $src_format $model $src_format "$WORKING_DIR" "$OSCAL_DIR")"
cmd_exitcode=$?
if [ -n "$result" ]; then
echo -e "${result}"
fi
cmd_exitcode=$?
if [ $cmd_exitcode -ne 0 ]; then
exitcode=1
continue;
Expand All @@ -430,18 +434,18 @@ process_paths() {
fi

result="$(copy_or_convert_content "$ARTIFACT_DIR" "$src_file" "${ARTIFACT_DIR}/src" $src_format $model $to_format "$WORKING_DIR" "$OSCAL_DIR")"
cmd_exitcode=$?
if [ -n "$result" ]; then
echo -e "${result}"
fi
cmd_exitcode=$?
if [ $cmd_exitcode -ne 0 ]; then
exitcode=1
continue;
fi

done
done
return $cmd_exitcode;
return $exitcode;
}

process_paths #"${paths[@]}" "${formats[@]}" "${models[@]}" "${conversion_formats[@]}"
Expand Down
Loading