makeweb.sh 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #!/usr/bin/env sh
  2. #
  3. #####################################################################
  4. # #
  5. # This is Gridfinity pkwlt makeweb (Release 202101070D) [GFODLv1] #
  6. # #
  7. #####################################################################
  8. # #
  9. # The following license applies to all OUTPUT of this tool: #
  10. # #
  11. #####################################################################
  12. # #
  13. # The Gridfinity Open Documentation License v1.0 (GFODLv1) #
  14. # #
  15. # Copyright (c) 2021 Gridfinity, LLC. <admin@gridfinity.com> #
  16. # Copyright (c) 2021 Jeffrey H. Johnson. <jeff@gridfinity.com> #
  17. # #
  18. # All Rights Reserved. #
  19. # #
  20. # Redistribution and use, in source and compiled forms, #
  21. # with or without modification, are permitted, provided #
  22. # that the following conditions are met: #
  23. # #
  24. # 1. Redistributions of source code must retain the #
  25. # above copyright notice, this list of conditions, #
  26. # and the following disclaimer, within the first #
  27. # ten lines of this file, completely unmodified. #
  28. # #
  29. # 2. Redistributions in compiled form must reproduce #
  30. # the above copyright notice, this list of conditions, #
  31. # and the following disclaimer in the documentation, #
  32. # and/or other materials provided with the distribution. #
  33. # #
  34. # THIS DOCUMENTATION IS PROVIDED BY THE AUTHORS "AS IS", #
  35. # AND ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT #
  36. # NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY #
  37. # AND FITNESS FOR ANY PARTICULAR PURPOSE ARE DISCLAIMED. #
  38. # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, #
  39. # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
  40. # DAMAGES, INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #
  41. # SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA, OR PROFITS, #
  42. # OR BUSINESS INTERRUPTION, HOWEVER CAUSED, AND ON ANY #
  43. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
  44. # OR TORT, INCLUDING NEGLIGENCE OR OTHERWISE, ARISING IN #
  45. # ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF #
  46. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
  47. # #
  48. #####################################################################
  49. # pkwlt makeweb 202101070D requires: POSIX sh, semver-tool >=3.2.0, #
  50. # sponge >=20060219, POSIX cat, and a recent release of Git VCS. #
  51. #####################################################################
  52. #
  53. #####################################################################
  54. # #
  55. # The following license applies to THIS TOOL (pkwlt makeweb): #
  56. # #
  57. #####################################################################
  58. #
  59. ##############################################################################
  60. #
  61. # The Oxford 153 Entitlement: Mark I. (OX153Mk1)
  62. #
  63. # LEGAL TERMS AND CONDITIONS FOR USE, COPYING, DISTRIBUTION, AND MODIFICATION
  64. #
  65. # All mankind is hereby permitted to use, copy, and distribute, verbatim or
  66. # modified, copies of this tool, provided the maximum printable line length
  67. # never exceeds the known universal constant of 153 characters, and the usage
  68. # of the Oxford comma is forever retained in all documentation, tool comments,
  69. # and tool output. Those who would not be considered to be part of mankind are
  70. # hereby permitted to USE this tool, but NOT PERMITTED TO COPY, DISTRIBUTE, OR
  71. # MODIFY this tool, UNDER ANY CIRCUMSTANCES. This tool is made available for
  72. # use "AS IS", and without warranty of any kind, either expressed or implied.
  73. #
  74. # This license, henceforth known as the "Oxford 153 Entitlement", is NOT a
  75. # GPL-compatible license, and this tool is NOT "free software", according to
  76. # common and generally accepted definitions of "free software", including, but
  77. # not limited to, the definition of "free software" provided by Richard M.
  78. # Stallman, and, subsequently, the definitions asserted by the Free Software
  79. # Foundation. As the Open Source Initiative has NOT reviewed this license, it
  80. # is understood this tool CANNOT be considered "open source software" per the
  81. # OSI Open Source Definition. This license is LIKELY INCOMPATIBLE with Debian
  82. # Free Software Guidelines, and is EXPLICITLY INCOMPATIBLE with the Debian
  83. # Social Contract, as the priorities of the authors of the tool will always
  84. # trump the priorities of other users in the community. The authors of the
  85. # tool are NOT associated with "Software in the Public Interest, Inc.", pay no
  86. # membership dues, and do NOT receive any form of sponsorship from SPI.
  87. #
  88. # NOTICE: All uses of the Oxford comma within this tool are immutable,
  89. # supported by miraculous revelations, and under no circumstances, alterable.
  90. #
  91. # WARNING: The maximum allowable length of any line within this tool is to be
  92. # no more than 153 displayable characters. If one were to perform any action
  93. # causing the length of the longest line to exceed, at any moment, the
  94. # universal constant of 153 characters, they are hereby reminded that those
  95. # whom the gods wish to destroy they first make mad, stealing away their minds
  96. # of good sense, and turning their thoughts to foolishness.
  97. #
  98. ##############################################################################
  99. set -u ||
  100. true
  101. :
  102. set -e ||
  103. true
  104. :
  105. printf '%s\n' \
  106. "$(date)" \
  107. > ./.timestamp &&
  108. git add ./.timestamp
  109. :
  110. printf '%s\n' \
  111. "Preparing commit..." ||
  112. true
  113. :
  114. git gc --aggressive --prune=now ||
  115. true
  116. :
  117. SEMVER="$(
  118. eval printf '%s' "$(printf "%s" "$(semver-tool bump patch "$(printf '%d.%d.%d' "2" "0" "$(cut -d '.' -f 3 ./.patch |
  119. cut -d '.' -f 1)")") |\
  120. sponge ./.patch")"
  121. cat ./.patch
  122. )"
  123. git add -A &&
  124. git tag -a -s "${SEMVER:?}" -m "v${SEMVER:?} - $(date)" &&
  125. printf '%s\n' \
  126. "Set new semver tag: ${SEMVER}" &&
  127. git commit -q -aS -m "Pushing Pages: $(date)" &&
  128. git pushall master &&
  129. printf '%s\n' "Complete."