-
Notifications
You must be signed in to change notification settings - Fork 13
Fixed issues with repeated validation errors / warnings #254
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6ae9ae7
GH Actions: Added build all test from build-index repo
olehermanse 3223d02
Fixed repeated warnings in cfbs validate while returning 0 (success)
olehermanse d78e296
Prevented spammy log messages about unknown keys in some commands
olehermanse dac376f
Renamed _validate_config() to validate_config_with_exceptions()
olehermanse 823e04d
Fixed shell test 11 after recent changes in build index
olehermanse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/usr/bin/env | ||
|
|
||
| # Requires / expects cfbs to already be installed | ||
| # Run from project root (will look for ./cfbs.json) | ||
| # in current working directory | ||
|
|
||
| set -e | ||
| set -x | ||
|
|
||
| rm -rf ./tmp/ | ||
| mkdir -p ./tmp/ | ||
|
|
||
| # This script is written to also work in for example cfengine/cfbs | ||
| # where we'd need to downooad cfbs.json. | ||
| if [ ! -f ./cfbs.json ] ; then | ||
| echo "No cfbs.json found in current working directory, downloading from GitHub" | ||
| curl -L https://raw.githubusercontent.com/cfengine/build-index/refs/heads/master/cfbs.json -o ./tmp/cfbs.json | ||
| else | ||
| cp ./cfbs.json ./tmp/cfbs.json | ||
| fi | ||
|
|
||
| cd ./tmp/ | ||
|
|
||
| # Move the index to another filename | ||
| mv cfbs.json index.json | ||
|
|
||
| # Initialize cfbs project | ||
| cfbs --non-interactive --index ./index.json init --masterfiles=no | ||
|
|
||
| # Add masterfiles | ||
| cfbs --non-interactive add masterfiles | ||
|
|
||
| # Validate the minimal project | ||
| cfbs validate | ||
|
|
||
| # Add all modules | ||
| cfbs search --index ./index.json | \ | ||
| awk '{print $1}' | \ | ||
| xargs -n1 cfbs --index ./index.json add | ||
|
|
||
| # Validate all modules | ||
| cfbs validate | ||
|
|
||
| # Build | ||
| cfbs build --ignore-versions-json | ||
|
|
||
| # Status | ||
| cfbs status | ||
|
|
||
| # Here we use root for everything to avoid permissions problems in policy that accesses files | ||
| # TODO: Enable later | ||
| #- name: Validate built policy | ||
| # run: | | ||
| # sudo pip3 install cfbs | ||
| # wget https://s3.amazonaws.com/cfengine.packages/quick-install-cfengine-enterprise.sh && sudo bash ./quick-install-cfengine-enterprise.sh agent | ||
| # sudo cfbs install | ||
| # # fake a bootstrap, lib-fim module expects stdlib to be in inputs with $(sys.libdir) | ||
| # sudo cp -r /var/cfengine/masterfiles/lib /var/cfengine/inputs | ||
| # sudo cf-promises -f /var/cfengine/masterfiles/promises.cf | ||
| # sudo cf-promises -vf /var/cfengine/masterfiles/update.cf | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Add, validate, and build all modules | ||
|
|
||
| # Controls when the workflow will run | ||
| on: | ||
| # Triggers the workflow on master every night at 3:15 am | ||
| schedule: | ||
| - cron: "15 3 * * *" | ||
|
|
||
| # Allows you to run this workflow manually from the Actions tab | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
| jobs: | ||
| # This workflow contains a single job called "build" | ||
| build: | ||
| # The type of runner that the job will run on | ||
| runs-on: ubuntu-latest | ||
|
|
||
| # Steps represent a sequence of tasks that will be executed as part of the job | ||
| steps: | ||
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
| - uses: actions/checkout@v2 | ||
olehermanse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Install cfbs with pip | ||
| run: pip3 install cfbs | ||
|
|
||
| # Downloading cfbs.json is needed to run this action in another repo, like cfengine/cfbs: | ||
| - name: Run test script | ||
| run: bash .github/workflows/add_validate_build_all.sh | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.