๐พ Archived View for source.community โบ jeffdecola โบ my-go-tools โบ blob โบ develop โบ ci โบ scripts โบ reโฆ captured on 2022-01-08 at 13:44:20. Gemini links have been rewritten to link to archived content
โฌ ๏ธ Previous capture (2021-12-17)
โก๏ธ Next capture (2023-07-10)
-=-=-=-=-=-=-
. ,-. ,-. . . ,-. ,-. ,-. ,-. ,-. ,-,-. ,-,-. . . ,-. . |- . . `-. | | | | | | |-' | | | | | | | | | | | | | | | | | `-' `-' `-^ ' `-' `-' :: `-' `-' ' ' ' ' ' ' `-^ ' ' ' `' `-| /| `-'
git clone https://source.community/jeffdecola/my-go-tools.git
View raw contents of /ci/scripts/readme-github-pages.sh (develop)
โโโโโฎ 1โ #!/bin/sh 2โ # my-go-tools readme-github-pages.sh 3โ 4โ echo " " 5โ 6โ if [ "$1" = "-debug" ] 7โ then 8โ echo "readme-github-pages.sh -debug (START)" 9โ # set -e causes the shell to exit if any subcommand or pipeline returns a non-zero status. Needed for concourse. 10โ # set -x enables a mode of the shell where all executed commands are printed to the terminal. 11โ set -e -x 12โ echo " " 13โ else 14โ echo "readme-github-pages.sh (START)" 15โ # set -e causes the shell to exit if any subcommand or pipeline returns a non-zero status. Needed for concourse. 16โ set -e 17โ echo " " 18โ fi 19โ 20โ echo "GOAL ----------------------------------------------------------------------------------" 21โ echo " " 22โ 23โ echo "The goal is to git clone /my-go-tools to /my-go-tools-updated" 24โ echo "Then script will edit the /docs/_includes/README.md for GITHUB WEBPAGES" 25โ echo "Finally push the changes in /docs/_includes/README.md to github" 26โ echo " " 27โ 28โ echo "CHECK THINGS --------------------------------------------------------------------------" 29โ echo " " 30โ 31โ echo "At start, you should be in a /tmp/build/xxxxx directory with two folders:" 32โ echo " /my-go-tools" 33โ echo " /my-go-tools-updated (created in task-build-push.yml task file)" 34โ echo " " 35โ 36โ echo "pwd is: $PWD" 37โ echo " " 38โ 39โ echo "List whats in the current directory" 40โ ls -la 41โ echo " " 42โ 43โ echo "GIT CLONE -----------------------------------------------------------------------------" 44โ echo " " 45โ 46โ echo "git clone my-go-tools to my-go-tools-updated" 47โ git clone my-go-tools my-go-tools-updated 48โ echo " " 49โ 50โ echo "cd my-go-tools-updated" 51โ cd my-go-tools-updated 52โ echo " " 53โ 54โ echo "List whats in the current directory" 55โ ls -la 56โ echo " " 57โ 58โ echo "EDIT README FOR GITHUB WEBPAGES -------------------------------------------------------" 59โ echo " " 60โ 61โ echo "Copy README.md to /docs/_includes/README.md and edit" 62โ echo " Remove everything before the second heading in README.md. Place in temp-README.md" 63โ echo " sed '0,/github webpage/d' README.md > temp-README.md" 64โ sed '0,/github webpage/d' README.md > temp-README.md 65โ echo " Change the first heading ## to #" 66โ echo " sed -i '0,/##/{s/##/#/}' temp-README.md" 67โ sed -i '0,/##/{s/##/#/}' temp-README.md 68โ echo " Update the image links (remove docs/)" 69โ echo " sed -i 's#IMAGE](docs/#IMAGE](#g' temp-README.md" 70โ sed -i 's#IMAGE](docs/#IMAGE](#g' temp-README.md 71โ echo " Update the image links for svgs (if you have them)" 72โ echo " Add \"https://raw.githubusercontent.com/JeffDeCola/REPONAME/master/svgs/\" to \"svgs/\"" 73โ echo " sed -i 's/svgs\//https:\/\/raw.githubusercontent.com\/JeffDeCola\/my-go-tools\/master\/svgs\//g' temp-README.md" 74โ sed -i 's/svgs\//https:\/\/raw.githubusercontent.com\/JeffDeCola\/my-go-tools\/master\/svgs\//g' temp-README.md 75โ echo " " 76โ 77โ echo "GIT COMMIT OR NOT ---------------------------------------------------------------------" 78โ echo " " 79โ 80โ commit="yes" 81โ 82โ echo "Does docs/_includes/README.md exist?" 83โ if test -f docs/_includes/README.md 84โ then 85โ echo " Yes, it exists." 86โ # CHECK IF THERE IS A DIFF 87โ if (cmp -s temp-README.md docs/_includes/README.md) 88โ then 89โ commit="no" 90โ echo " No changes are needed, Do not need to git commit and push" 91โ else 92โ echo " Updates are needed" 93โ fi 94โ echo " " 95โ else 96โ echo " No, it does not exist" 97โ echo " Creating the _includes directory if it doesn't exist" 98โ mkdir -p docs/_includes 99โ echo " " 100โ fi 101โ 102โ if [ "$commit" = "yes" ] 103โ then 104โ 105โ echo "GIT SETUP -------------------------------------------------------------------------" 106โ echo " " 107โ 108โ echo "cp temp-README.md docs/_includes/README.md" 109โ cp temp-README.md docs/_includes/README.md 110โ echo " " 111โ 112โ echo "Update some global git variables" 113โ echo "git config --global user.email \"jeffdecola@gmail.com\"" 114โ echo "git config --global user.name \"Jeff DeCola (Concourse)\"" 115โ git config --global user.email "jeffdecola@gmail.com" 116โ git config --global user.name "Jeff DeCola (Concourse)" 117โ echo " " 118โ git config --list 119โ echo " " 120โ 121โ echo "GIT PUSH MASTER BRANCH ------------------------------------------------------------" 122โ echo " " 123โ 124โ echo "git add and commit what is needed to protect from unforseen issues" 125โ echo "git add docs/_includes/README.md" 126โ git add docs/_includes/README.md 127โ echo " " 128โ 129โ echo " git commit -m \"Update docs/_includes/README.md for GitHub WebPage\"" 130โ git commit -m "Update docs/_includes/README.md for GitHub WebPage" 131โ echo " " 132โ 133โ echo "git status" 134โ git status 135โ echo " " 136โ 137โ echo "git push - Not needed here since its done in pipeline" 138โ echo " " 139โ fi 140โ 141โ echo "CLEAN UP ------------------------------------------------------------------------------" 142โ echo " " 143โ 144โ echo "rm temp-README.md" 145โ rm temp-README.md 146โ echo " " 147โ 148โ echo "readme-github-pages.sh (END)" 149โ echo " " โโโโโฏ
ยท ยท ยท
ยฉ 2022 source.community