Skip to content

Commit

Permalink
* **feat**: Add semantic-release to contra-env-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ari LiVigni committed Nov 7, 2019
1 parent 05729c1 commit 8fdcdd8
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 47 deletions.
76 changes: 76 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/usr/bin/env bash

# Copyright Red Hat, Inc

################################################################
# Note: #
# This git hook script will perform the following before #
# completing the `git commit` command: #
# - Remove and recreate the docs/ folder #
# - Create a docs/vars and docs/src folder #
# - Copy the html documentation files from vars/ to docs/vars #
# - Generate groovydoc documentation for files in src/ and #
# place them in docs/src #
# - Create an index.html file in docs/ linking to both src and #
# vars documentation #
################################################################

echo "Regenerating documentation"

# Remove old docs directory and recreate src and vars subdirs
rm -rf docs
mkdir -p docs/vars docs/src

# Create MD docs from the html versions
for htmlFile in vars/*.txt; do
mdFile=${htmlFile/#vars/docs/vars}
mdFile=${mdFile/%txt/md}
pandoc $htmlFile -f html -t markdown -s -o $mdFile
done

echo "## Documentation Index" > docs/index.md
echo "" >> docs/index.md
echo "- src" >> docs/index.md
echo " - [index](src/index.html)" >> docs/index.md
echo "- vars" >> docs/index.md
for mdFile in docs/vars/*; do
if [ "${mdFile}" != "index.md" ]; then
filename=($(basename ${mdFile} .md))
echo " - [${filename}](vars/${filename}.md)" >> docs/index.md
fi
done

# Copy html files with txt extension from vars/ to docs/vars
# Rename files from txt extension to html extension
cp vars/*.txt docs/vars
rename .txt .html docs/vars/*.txt

# Creating index of new docs
cd docs
echo """
<html>
<head></head>
<body>
<h1>rhProd Documentation Index</h1>
<ul>
<li><a href="src/index.html">src</a></li>
<li>vars</li>
<ul>""" > index.html
for htmlFile in vars/*; do
filename=($(basename ${htmlFile} .md))
echo " <li><a href="${htmlFile}">${filename}</a></li>" >> index.html
done
echo """ </ul>
</ul>
</body>
</html>
""" >> index.html

cd ..

# Create groovydoc
#echo "Creating groovydocs for src"
groovydoc -d docs/src -private -nomainforscripts -noversionstamp -notimestamp -sourcepath src $(find src/ -name \*.groovy -printf '%P\n')

echo "Adding regenerated documentation to commit"
git add docs
14 changes: 14 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
["@semantic-release/github", {
"githubUrl": "https://github.com"
}],
["@semantic-release/git", {
"assets": ["CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [ci-skip]\n\n${nextRelease.notes}"
}]
]
}
8 changes: 8 additions & 0 deletions .sgcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"scope": true,
"lowercaseTypes": true,
"addScopeSpace": false,
"rules": {
"endWithDot": false
}
}
140 changes: 93 additions & 47 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
# Changelog

## v1.3.3 (06/24/2019)
- Add conditions to install proper pkgs in Fedora 30 [#159](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/159)
## [v1.3.3](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.3.2..v1.3.3) (2019-06-24)

### Bug Fixes

- Reset git http.sslverify setting after setup is done [#157](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/157)
- Remove DNS hack [#156](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/156)

## v1.3.2 (03/25/2019)
- When checking the status of container builds always check the latest one [#154](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/154)
- Add support for template overwriting [#153](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/153)
### Features

- Add conditions to install proper pkgs in Fedora 30 [#159](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/159)

## [v1.3.2](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.3.1..v1.3.2) (2019-03-25)

### Bug Fixes

- Add DNS fix to include RHOS VM task as well [#151](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/151)
- Add general dns to fix fleeting DNS errors [#150](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/150)
- When checking the status of container builds always check the latest one [#154](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/154)

### Features

- Add support for template overwriting [#153](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/153)

## [v1.3.1](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.3.0..v1.3.1) (2019-02-27)

### Bug Fixes

## v1.3.1 (02/27/2019)
- Add a playbook that prepares external VMs for usage with minishift [#148](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/148)
- Fix the query for the oc compressed binary to search links only [#147](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/147)
- Pickup templates with extension .j2 [#146](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/146)
- Fix KVM driver installation step [#144](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/144)
Expand All @@ -23,7 +36,14 @@
- Update README.md with better more accurate examples [#138](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/138)
- Update with metrics vars, README update [#136](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/136)

## v1.3.0 (01/14/2019)
### Features

- Add a playbook that prepares external VMs for usage with minishift [#148](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/148)

## [v1.3.0](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.2.1..v1.3.0) (2019-01-14)

### Bug Fixes

- Fix confusing name of tasks [#134](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/134)
- Use raw-ouput from jq instead of sed [#100](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/100)
- explicit use of templates [#132](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/132)
Expand Down Expand Up @@ -59,11 +79,17 @@
- Make sure configured minishift profile is active [#79](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/79)
- Make changes to allow for mac users [#81](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/81)
- setup or start minishift if true [#80](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/80)
- More robust way of detecting if minishift profile exists [#78](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/78)
- Revert "use github api" [#76](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/76)
- Add CHANGELOG.md for release generation [#77](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/77)

## v1.2.1 (03/09/2018)
### Features

- More robust way of detecting if minishift profile exists [#78](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/78)

## [v1.2.1](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.2.0..v1.2.1) (2018-03-09)

### Bug Fixes

- use github api [#75](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/75)
- Support the case where project does not contain a display name [#73](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/73)
- Log and cleanup failed builds [#65](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/65)
Expand All @@ -79,81 +105,101 @@
- Change from using yum or dnf to use package [#62](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/62)
- Add missing reference to user for kvm setup [#61](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/61)

---
## [v1.2.0](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.1.7..v1.2.0) (2018-06-29)

### Bug Fixes

## v1.2.0 (29/06/2018)
- Build container images in parallel [#59](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/59)
- Updated versions of minishift and minishift.iso [#57](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/57)

---
### Features

- Build container images in parallel [#59](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/59)

## [v1.1.7](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.1.6..v1.1.7) (2018-06-21)

### Bug Fixes

## v1.1.7 (21/06/2018)
- use Running to detect queued [#56](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/56)

---
## [v1.1.6](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.1.5..v1.1.6) (2018-06-20)

### Bug Fixes

## v1.1.6 (20/06/2018)
- Detect New state when querying for queued build [#55](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/55)

### Features

- Allow to set insecure registry with minishift [#52](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/52)
- Added option to disable loading of the helper containers [#51](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/51)

---
## [v1.1.5](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.1.4..v1.1.5) (2018-06-14)

### Bug Fixes

## v1.1.5 (14/06/2018)
- Skip non template yaml files when setting up containers [#50](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/50)
- Rework importing of os templates [#49](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/49)
- Rework importing of os templates [#49](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/49)

## [v1.1.4](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.1.3..v1.1.4) (2018-06-06)

---
### Bug Fixes

## v1.1.4 (06/06/2018)
- Fixed type-o of option [#47](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/47)

---
## [v1.1.3](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.1.2..v1.1.4) (2018-05-31)

### Features

## v1.1.3 (31/05/2018)
- Load helper containers and add start_minishift option [#44](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/44)

---
## [v1.1.2](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.1.1..v1.1.2) (2018-05-30)

### Bug Fixes

## v1.1.2 (30/05/2018)
- Use longer version for imagestream [#42](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/42)

---
## [v1.1.1](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.1.0..v1.1.1) (2018-05-23)

### Features

## v1.1.1 (23/05/2018)
- Add the ability to specify adhoc oc commands [#40](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/40)

---
## [v1.1.0](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.0.1..v1.1.0) (2018-05-18)

### Features

## v1.1.0 (18/05/2018)
- Allow setting of Project Display Name [#38](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/38)

---
## [v1.0.1](https://github.com/CentOS-PaaS-SIG/contra-env-setup/compare/v1.0.0..v1.0.1) (2018-05-14)

### Bug Fixes

## v1.0.1 (14/05/2018)
- Increase default version of OpenShift and up memory to 8092 [#36](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/36)

---
## [v1.0.0](https://github.com/CentOS-PaaS-SIG/contra-env-setup/releases/tag/v1.0.0) (2018-05-10)

### Bug Fixes

## v1.0.0 (10/05/2018)
- Support use case when not using minishift [#35](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/35)
- add support for setting # of cpus [#34](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/34)
- fixing some issues from ansible-lint in setup_pipelines.yml [#31](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/31)
- Add ability to use ansible variables in s2i templates [#32](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/32)
- Change to use oc and minishift binaries full path [#30](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/30)
- Correct memory parameter name [#29](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/29)
- [**bug**][**enhancement**] support for running tests on centos 7 [v2] [#28](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/28)
- Updated README and changing options [#26](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/26)
- Setup pipelines through OpenShift buildconfig templates [#25](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/25)
- [**enhancement**] Some improvements in the test automation [v2] [#22](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/22)
- Update README and fix pipeline template destination [#24](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/24)
- Setup sample_os_templates and sample_pipelines [#23](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/23)
- [**enhancement**] Improved the test automation [#19](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/19)
- Change to use oc and minishift binaries full path [#30](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/30)
- Update README and fix pipeline template destination [#24](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/24)
- Add http.sslVerify false for git and fix loading templates [#18](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/18)
- Correct memory parameter name [#29](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/29)
- Updated README and changing options [#26](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/26)
- Change to compare filename to scc name [#17](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/17)
- Update README [#16](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/16)
- contra-env-setup stability [#15](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/15)
- fixed warning about deprecated 'include' [#5](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/5)
- Updated README with a better heading [#3](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/3)
- Added logo [#2](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/2)

### Features

- Support use case when not using minishift [#35](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/35)
- Add support for setting # of cpus [#34](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/34)
- Add ability to use ansible variables in s2i templates [#32](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/32)
- Support for running tests on centos 7 [v2] [#28](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/28)
- Setup pipelines through OpenShift buildconfig templates [#25](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/25)
- [**enhancement**] Some improvements in the test automation [v2] [#22](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/22)
- Setup sample_os_templates and sample_pipelines [#23](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/23)
- [**enhancement**] Improved the test automation [#19](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/19)
- Initial commit to setup the repo [#1](https://github.com/CentOS-PaaS-SIG/contra-env-setup/pull/1)
16 changes: 16 additions & 0 deletions install_git_hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# Copyright Red Hat, Inc

###
#
# Please ensure that you list any hooks you're installing in the echo
# statement below and indicate what function it provides.
#
##

echo """
This will install the following git hooks:
- pre-commit: This hook will automatically regenerate documentation
"""
find .git/hooks -type l -exec rm {} \; && find .githooks -type f -exec ln -sf ../../{} .git/hooks/ \;

0 comments on commit 8fdcdd8

Please sign in to comment.