Skip to content

Commit

Permalink
fixed comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed Jun 6, 2019
1 parent 5444422 commit bf6f70b
Show file tree
Hide file tree
Showing 27 changed files with 139 additions and 126,766 deletions.
193 changes: 3 additions & 190 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,12 @@ jobs: # a collection of
- *attach_build_workspace
- install-maven
- install-saxon
- install-ajv
- install-lxml
- run:
name: Generate round trip XML and JSON conversions
command: |
bash "${CICD_DIR}/roundTripXML.sh" "$OSCAL_BUILD_DIR"
*publish_artifacts
- *publish_artifacts
job-generate-docs:
executor: java-executor
steps:
Expand Down Expand Up @@ -379,9 +378,7 @@ workflows:
build:
jobs:
- job-ci-skip-check
- job-roundtrip-conversions
- job-validate-markdown:

requires:
- job-ci-skip-check
filters:
Expand All @@ -404,194 +401,10 @@ workflows:
- job-validate-content:
requires:
- job-generate-schema
- job-copy-and-convert-content:
requires:
- job-generate-converters
- job-validate-content
- job-generate-docs:
- job-roundtrip-conversions:
requires:
- job-validate-metaschema
- job-generate-converters
- job-validate-site-content:
requires:
- job-generate-docs
filters:
branches:
# only from PRs
ignore:
- master
- nist-pages
- job-deploy-artifacts:
requires:
- job-copy-and-convert-content
filters:
branches:
only: master
- job-build-and-deploy-website:
requires:
- job-generate-docs
- job-deploy-artifacts
filters:
branches:
only: master
- install-xmllint
- install-ajv
- run:
name: Validate content instances
command: |
bash "$CICD_DIR/validate-content.sh" "$OSCAL_BUILD_DIR"
job-roundtrip-conversions:
executor: python-executor
steps:
- *checkout
- *attach_build_workspace
- install-maven
- install-saxon
- install-ajv
- install-lxml
- run:
name: Generate round trip XML and JSON conversions
command: |
bash "${CICD_DIR}/roundTripXML.sh" "$OSCAL_BUILD_DIR"
*publish_artifacts
job-generate-docs:
executor: java-executor
steps:
- *checkout
- *attach_build_workspace
- check-skip-build
- install-saxon
- run:
name: Generate schema documentation
command: |
#cp -r "$OSCAL_BUILD_DIR"/* "$OSCAL_REPO_DIR"
bash -x "$CICD_DIR/generate-model-documentation.sh" "$OSCAL_BUILD_DIR"
# echo "-- fix the fact that we cannot generate directly to the build directory due to a bug"
# mv docs "$OSCAL_BUILD_DIR"/docs
- *publish_artifacts
- persist_to_workspace:
root: build_artifacts
paths:
- docs
job-deploy-artifacts:
executor: java-executor
steps: # a collection of executable commands
- *checkout
- *attach_build_workspace
- check-skip-build
- deploy: # delete and copy artifacts before deploy
name: Commit Artifacts
command: |
cd "$OSCAL_REPO_DIR"
# Remove existing generated files
git rm -r --ignore-unmatch xml/convert/*.xsl
git rm -r --ignore-unmatch xml/schema/*.xsd
git rm -r --ignore-unmatch json/convert/*.xsl
git rm -r --ignore-unmatch json/schema/*.json
git rm -r --ignore-unmatch content/**/*.xml
git rm -r --ignore-unmatch content/**/*.json
git rm -r --ignore-unmatch content/**/*.yaml
# Copy new built files to repo
cd -
cp -r "$OSCAL_BUILD_DIR"/* "$OSCAL_REPO_DIR"
cd "$OSCAL_REPO_DIR"
# add the new files
git add -f --all xml
git add -f --all json
git add -f --all content
# check for changes
echo "Changed files:"
if ! $(git diff --exit-code --name-only HEAD~1 xml json content); then
# Only deploy if something relevant has changed
# Setup deployment
git config user.name "Deployment Bot"
git commit --allow-empty -m "Deploying content [ci deploy skip]"
# Ensure we are deploying against the latest
git fetch
git rebase origin/master
# deploy
git push
else
echo " No files changed"
fi
- *publish_artifacts
job-validate-site-content:
executor: ruby-node-executor
steps:
- *checkout
- *attach_build_workspace
- check-skip-build
- *restore_gem_cache
- install-bundler
- run:
name: Build jekyll site
command: |
cp -vr "$OSCAL_BUILD_DIR"/* "$OSCAL_REPO_DIR"
cd "$OSCAL_REPO_DIR/docs"
bundle exec jekyll build -d _site/OSCAL
htmlproofer --assume-extension ./_site
environment:
JEKYLL_ENV: production
- *save_gem_cache
- *publish_artifacts
job-build-and-deploy-website:
executor: ruby-node-executor
steps:
- *checkout
- *attach_build_workspace
- check-skip-build
- *restore_gem_cache
- install-bundler
- run:
name: Build jekyll site
command: |
cp -vr "$OSCAL_BUILD_DIR"/* "$OSCAL_REPO_DIR"
cd "$OSCAL_REPO_DIR/docs"
bundle exec jekyll build
mkdir -p _site/.circleci
# copy the circleci config
cp ../.circleci/config.yml _site/.circleci/config.yml
environment:
JEKYLL_ENV: production
- *save_gem_cache
- run:
name: Run deploy script
command: |
cd "$OSCAL_REPO_DIR/docs"
git config user.name "Deployment Bot"
bash ./deploy.sh --push-only -v -m "Deploying website [ci deploy skip]"
- *publish_artifacts
workflows:
version: 2
build:
jobs:
- job-ci-skip-check
- job-roundtrip-conversions
- job-validate-markdown:

requires:
- job-ci-skip-check
filters:
branches:
ignore:
- master
- nist-pages
- job-validate-metaschema:
requires:
- job-ci-skip-check
filters:
branches:
ignore: nist-pages
- job-generate-schema:
requires:
- job-validate-metaschema
- job-generate-converters:
requires:
- job-validate-metaschema
- job-validate-content:
requires:
- job-generate-schema
- job-validate-content
- job-copy-and-convert-content:
requires:
- job-generate-converters
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
# Proprietary files not to be propagated
vault

# oXygen XML Editor IDE file
# IDE files
*.xpr
/OSCAL-dev.xpr
.vscode

# Working files
scratch
Expand Down
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

9 changes: 1 addition & 8 deletions build/ci-cd/config/content
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
# path to source|format of source|model of source|format(s) to convert to
#### FedRAMP Round Trips (throwing errors)
# src/content/fedramp.gov/xml/*catalog.xml|xml|catalog|json
# src/content/fedramp.gov/xml/*profile.xml|xml|profile|json
#### NIST 800-53 round trips
src/content/fedramp.gov/xml/*profile.xml|xml|profile|json
src/content/nist.gov/SP800-53/rev4/xml/*catalog.xml|xml|catalog|json
src/content/nist.gov/SP800-53/rev4/xml/*profile.xml|xml|profile|json
#### Not yet ready for JSON round trips
content/nist.gov/SP800-53/rev4/json/*catalog.json|json|catalog|xml
content/nist.gov/SP800-53/rev4/json/*profile.json|json|profile|xml

Binary file removed build/ci-cd/python/saxon9he.jar
Binary file not shown.
Loading

0 comments on commit bf6f70b

Please sign in to comment.