makeweb.sh 6.7 KB

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