Skip to content

Instantly share code, notes, and snippets.

@fatso83
Last active January 21, 2017 10:43
Show Gist options
  • Save fatso83/05280a7bcdbbb3f1df26f7e5c4e56fcc to your computer and use it in GitHub Desktop.
Save fatso83/05280a7bcdbbb3f1df26f7e5c4e56fcc to your computer and use it in GitHub Desktop.
Skript for å generere en deploybeskrivelse i Octopus med Markdown-formatering
#!/bin/bash
# Skript for å generere en deploybeskrivelse i Octopus med HTML-formatering
if (( $# < 2 )); then
echo "Oppgi commitid-en tilsvarende siste deploy som første argument"
echo "Oppgi kjedenavn (ultra, meny, joker) som andre argument"
echo -e "Eksempel:\n\toctopus-description.sh 8f7c4f6 meny"
exit 1
fi
github_base="https:\/\/github.com\/MWNG\/multikanal.epi7.$2"
github_commit="$github_base\/commit\/"
github_compare="$github_base\/compare\/"
function linkify_git_oneline(){
sed -E \
-e "s/^([[:alnum:]]+) (.*)/<li>\2 (<a href=\"$github_commit\1\">\1<\/a>)<\/li>/"
}
function linkify_commit_compare(){
sed -E \
-e "s/^([[:alnum:].]+)/<a href=\"$github_compare\1\">\1<\/a>/"
}
function last_commit(){
git log --oneline -n1 | awk '{print $1}'
}
echo "<h3>Mest interessante endringer i denne releasen</h3>"
echo "<p>"
echo "<!-- denne seksjonen kan senere bli auto-utfylt fra seksjoner i committene -->"
echo " ------ FYLL INN ------"
echo "</p>"
echo "<details>"
echo -e "<summary>Ny kode siden forrige release ($(echo $1...$(last_commit) | linkify_commit_compare))</summary>\n"
echo "<ul>"
git log --oneline $1..| linkify_git_oneline
echo "</ul>"
echo "</details>"
echo -e "\n<a href="https://gist.github.com/05280a7bcdbbb3f1df26f7e5c4e56fcc">Auto-generert</a>"
@fatso83
Copy link
Author

fatso83 commented Dec 1, 2016

Eksempeloutput

Per 2016-12-01

Mest interessante endringer siden forrige release (8f7c4f6...c8e3df9)

  • fix typo in build script (c8e3df9)
  • Remove whitespace breaking msbuild (e8311a8)
  • Merge branch 'Feature/reachme-vacancy' into 3.0_develop (ee9bf55)
  • Added login button the joblistpage (05a7095)
  • added null check on list rendering (ab77909)
  • moved jobdetails specific css to jobdetails.scss. Removed unused code (01a9ac9)
  • minor sass changes (f1433e8)
  • Using list properties to render contact person info (65757c6)
  • testing class/scss changes (03e5cea)
  • Resolving breadcrumbs in pagecontextactionfilter. (525c99a)
  • added styles and modified existing ones used on jobdetails and index page. (f9f548b)
  • Modified controller logic to work with new vacancy implementation. Added reachmee config values (6d301f1)
  • update bourbon and bourbon-neat (68fafa3)
  • Merge branch 'build-script' into 3.0_develop (c536b4a)
  • Explain what these scripts are for (543734f)
  • Update example data to make all tests pass (0b576a1)
  • Add build-script for win and nix (0e9e75b)
  • Remove unused variables (af51162)
  • overflowing image on smaller screens fix (1c92f19)

Autogenerert for din nytelse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment