-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from lacework/afiune/fix
fix(cli): generate html for scan commands
- Loading branch information
Showing
7 changed files
with
154 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
# Go test coverage | ||
coverage.out | ||
circleci-artifacts/ | ||
|
||
# for building binary files | ||
bin/ |
This file contains 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 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 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 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 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 |
---|---|---|
|
@@ -15,6 +15,8 @@ readonly org_name=lacework | |
readonly package_name=lacework-cli | ||
readonly binary_name=lacework | ||
readonly docker_org=lacework | ||
readonly git_user="Salim Afiune Maya" | ||
readonly git_email="[email protected]" | ||
readonly docker_tags=( | ||
latest | ||
scratch | ||
|
@@ -80,25 +82,16 @@ main() { | |
} | ||
|
||
trigger_release() { | ||
if [[ "$VERSION" =~ "-release" ]]; then | ||
log "VERSION has 'x.y.z-release' tag. Triggering a release!" | ||
log "" | ||
log "removing release tag from version '${VERSION}'" | ||
remove_tag_version | ||
log "commiting and pushing the version bump to github" | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Salim Afiune Maya" | ||
git add VERSION | ||
git add api/version.go # file genereted by scripts/version_updater.sh | ||
git commit -m "trigger release v$VERSION" | ||
git push origin master | ||
tag_release | ||
bump_version | ||
else | ||
if [[ "$VERSION" =~ "-dev" ]]; then | ||
log "No release needed. (VERSION=${VERSION})" | ||
log "" | ||
log "Read more about the release process at:" | ||
log " - https://github.com/${org_name}/${project_name}/wiki/Release-Process" | ||
else | ||
log "VERSION ready to be released to 'x.y.z' tag. Triggering a release!" | ||
log "" | ||
tag_release | ||
bump_version | ||
fi | ||
} | ||
|
||
|
@@ -123,14 +116,14 @@ verify_release() { | |
fi | ||
done | ||
|
||
if [[ "$VERSION" =~ "-release" ]]; then | ||
log "(required) VERSION has 'x.y.z-release' tag. Great!" | ||
else | ||
warn "the 'VERSION' needs to be updated to have the 'x.y.z-release' tag" | ||
if [[ "$VERSION" =~ "-dev" ]]; then | ||
warn "the 'VERSION' needs to be cleaned up to be only 'x.y.z' tag" | ||
warn "" | ||
warn "Read more about the release process at:" | ||
warn " - https://github.com/${org_name}/${project_name}/wiki/Release-Process" | ||
exit 123 | ||
else | ||
log "(required) VERSION has been cleaned up to 'x.y.z' tag. Great!" | ||
fi | ||
} | ||
|
||
|
@@ -141,7 +134,6 @@ prepare_release() { | |
cli_generate_files | ||
generate_release_notes | ||
update_changelog | ||
add_tag_version "release" | ||
push_release | ||
} | ||
|
||
|
@@ -174,23 +166,56 @@ update_changelog() { | |
load_list_of_changes() { | ||
latest_version=$(find_latest_version) | ||
local _list_of_changes=$(git log --no-merges --pretty="* %s (%an)([%h](https://github.com/${org_name}/${project_name}/commit/%H))" ${latest_version}..master) | ||
echo "## Features" > CHANGES.md | ||
echo "$_list_of_changes" | grep "\* feat[:(]" >> CHANGES.md | ||
echo "## Refactor" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* refactor[:(]" >> CHANGES.md | ||
echo "## Performance Improvements" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* perf[:(]" >> CHANGES.md | ||
echo "## Bug Fixes" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* fix[:(]" >> CHANGES.md | ||
echo "## Documentation Updates" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* doc[:(]" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* docs[:(]" >> CHANGES.md | ||
echo "## Other Changes" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* style[:(]" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* chore[:(]" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* build[:(]" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* ci[:(]" >> CHANGES.md | ||
echo "$_list_of_changes" | grep "\* test[:(]" >> CHANGES.md | ||
|
||
# init changes file | ||
true > CHANGES.md | ||
|
||
_feat=$(echo "$_list_of_changes" | grep "\* feat[:(]") | ||
_refactor=$(echo "$_list_of_changes" | grep "\* refactor[:(]") | ||
_perf=$(echo "$_list_of_changes" | grep "\* perf[:(]") | ||
_fix=$(echo "$_list_of_changes" | grep "\* fix[:(]") | ||
_doc=$(echo "$_list_of_changes" | grep "\* doc[:(]") | ||
_docs=$(echo "$_list_of_changes" | grep "\* docs[:(]") | ||
_style=$(echo "$_list_of_changes" | grep "\* style[:(]") | ||
_chore=$(echo "$_list_of_changes" | grep "\* chore[:(]") | ||
_build=$(echo "$_list_of_changes" | grep "\* build[:(]") | ||
_ci=$(echo "$_list_of_changes" | grep "\* ci[:(]") | ||
_test=$(echo "$_list_of_changes" | grep "\* test[:(]") | ||
|
||
if [ "$_feat" != "" ]; then | ||
echo "## Features" >> CHANGES.md | ||
echo "$_feat" >> CHANGES.md | ||
fi | ||
|
||
if [ "$_refactor" != "" ]; then | ||
echo "## Refactor" >> CHANGES.md | ||
echo "$_refactor" >> CHANGES.md | ||
fi | ||
|
||
if [ "$_perf" != "" ]; then | ||
echo "## Performance Improvements" >> CHANGES.md | ||
echo "$_perf" >> CHANGES.md | ||
fi | ||
|
||
if [ "$_fix" != "" ]; then | ||
echo "## Bug Fixes" >> CHANGES.md | ||
echo "$_fix" >> CHANGES.md | ||
fi | ||
|
||
if [ "${_docs}${_doc}" != "" ]; then | ||
echo "## Documentation Updates" >> CHANGES.md | ||
if [ "$_doc" != "" ]; then echo "$_doc" >> CHANGES.md; fi | ||
if [ "$_docs" != "" ]; then echo "$_docs" >> CHANGES.md; fi | ||
fi | ||
|
||
if [ "${_style}${_chore}${_build}${_ci}${_test}" != "" ]; then | ||
echo "## Other Changes" >> CHANGES.md | ||
if [ "$_style" != "" ]; then echo "$_style" >> CHANGES.md; fi | ||
if [ "$_chore" != "" ]; then echo "$_chore" >> CHANGES.md; fi | ||
if [ "$_build" != "" ]; then echo "$_build" >> CHANGES.md; fi | ||
if [ "$_ci" != "" ]; then echo "$_ci" >> CHANGES.md; fi | ||
if [ "$_test" != "" ]; then echo "$_test" >> CHANGES.md; fi | ||
fi | ||
} | ||
|
||
generate_release_notes() { | ||
|
@@ -297,6 +322,8 @@ bump_version() { | |
fi | ||
|
||
log "commiting and pushing the vertion bump to github" | ||
git config --global user.email $git_email | ||
git config --global user.name $git_user | ||
git add VERSION | ||
git add api/version.go # file genereted by scripts/version_updater.sh | ||
git commit -m "version bump to v$VERSION" | ||
|