Initial commit.
authorHisataka Kasuga <hkasuga@nabium.com>
Tue, 18 Apr 2023 15:14:39 +0000 (00:14 +0900)
committerHisataka Kasuga <hkasuga@nabium.com>
Tue, 18 Apr 2023 15:15:11 +0000 (00:15 +0900)
21 files changed:
.gitignore [new file with mode: 0644]
bin/Apache Archiva.url [new file with mode: 0644]
bin/run-archiva.cmd [new file with mode: 0755]
bin/run-pgcmd-local.cmd [new file with mode: 0755]
bin/run-pgcmd.cmd [new file with mode: 0755]
bin/run-pgcreatedb.cmd [new file with mode: 0755]
bin/run-pginit.cmd [new file with mode: 0755]
bin/run-pgserver-stop.cmd [new file with mode: 0755]
bin/run-pgserver.cmd [new file with mode: 0755]
bin/start_py26.cmd [new file with mode: 0755]
bin/start_py27.cmd [new file with mode: 0755]
bin/start_vagrant.cmd [new file with mode: 0755]
doc/postgresql.md [new file with mode: 0644]
doc/readme.md [new file with mode: 0644]
etc/env-app.cmd [new file with mode: 0644]
etc/env-archiva.cmd [new file with mode: 0644]
etc/env-jre8.cmd [new file with mode: 0644]
etc/env-pgbase.cmd [new file with mode: 0644]
etc/env-pglocal.cmd [new file with mode: 0644]
etc/env-proxy.cmd [new file with mode: 0644]
etc/pgpwfile [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..9478251
--- /dev/null
@@ -0,0 +1,6 @@
+/Vagrant/
+/apache-*/
+/jdk8u*/
+/pgsql*/
+/doc/local-*.md
+/etc/local-*.cmd
diff --git a/bin/Apache Archiva.url b/bin/Apache Archiva.url
new file mode 100644 (file)
index 0000000..2df2f91
--- /dev/null
@@ -0,0 +1,2 @@
+[InternetShortcut]\r
+URL=http://localhost:8080/#welcome\r
diff --git a/bin/run-archiva.cmd b/bin/run-archiva.cmd
new file mode 100755 (executable)
index 0000000..c160adc
--- /dev/null
@@ -0,0 +1,12 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-jre8.cmd\r
+call %~dp0..\etc\env-archiva.cmd\r
+\r
+cd /d %ARCHIVA_HOME%\r
+\r
+call bin\archiva.bat console\r
+\r
+endlocal\r
+pause\r
diff --git a/bin/run-pgcmd-local.cmd b/bin/run-pgcmd-local.cmd
new file mode 100755 (executable)
index 0000000..06444b0
--- /dev/null
@@ -0,0 +1,8 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-pglocal.cmd\r
+\r
+start "postgres localhost:5432" /D %PGBASE%\r
+\r
+endlocal\r
diff --git a/bin/run-pgcmd.cmd b/bin/run-pgcmd.cmd
new file mode 100755 (executable)
index 0000000..498c29b
--- /dev/null
@@ -0,0 +1,8 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-pgbase.cmd\r
+\r
+start "postgres" /D %PGBASE%\r
+\r
+endlocal\r
diff --git a/bin/run-pgcreatedb.cmd b/bin/run-pgcreatedb.cmd
new file mode 100755 (executable)
index 0000000..14287ca
--- /dev/null
@@ -0,0 +1,58 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-pglocal.cmd\r
+\r
+:get_locale\r
+set locale=1\r
+echo   1 unix(UTF-8)\r
+echo   2 windows(CP932)\r
+echo   3 C\r
+echo   q quit\r
+echo locale:\r
+\r
+set /p locale=\r
+\r
+if "%locale%" equ "1" (\r
+    set locale=ja_JP.UTF8\r
+) else if "%locale%" equ "2" (\r
+    set locale=Japanese_Japan.932\r
+) else if "%locale%" equ "3" (\r
+    set locale=C\r
+) else if /I "%locale%" equ "q" (\r
+    goto :end\r
+) else (\r
+    goto :get_locale\r
+)\r
+\r
+:get_dbname\r
+echo dbname:\r
+set dbname=\r
+set /p dbname=\r
+\r
+if "%dbname%" equ "" (\r
+    goto :get_dbname\r
+)\r
+\r
+:get_confirm\r
+echo createdb -T template0 -E UTF8 -l %locale% -U %PGUSER% "%dbname%"\r
+echo proceed? (y / n):\r
+\r
+set confirm=\r
+set /p confirm=\r
+\r
+if /I "%confirm%" equ "y" (\r
+    rem\r
+) else if /I "%confirm%" equ "n" (\r
+    goto :end\r
+) else if /I "%confirm%" equ "q" (\r
+    goto :end\r
+) else (\r
+    goto :get_confirm\r
+)\r
+\r
+createdb -T template0 -E UTF8 -l %locale% -U %PGUSER% "%dbname%"\r
+\r
+:end\r
+endlocal\r
+pause\r
diff --git a/bin/run-pginit.cmd b/bin/run-pginit.cmd
new file mode 100755 (executable)
index 0000000..f8395d0
--- /dev/null
@@ -0,0 +1,15 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-pglocal.cmd\r
+\r
+rem ### Initialize DB Cluster\r
+if exist %PGDATA% (\r
+    echo Already exists: %PGDATA%\r
+) else (\r
+    initdb -D %PGDATA% --encoding=UTF8 --locale=C --username=postgres --pwfile=%~dp0..\etc\pgpwfile\r
+    rem --auth-host=md5\r
+)\r
+\r
+endlocal\r
+pause\r
diff --git a/bin/run-pgserver-stop.cmd b/bin/run-pgserver-stop.cmd
new file mode 100755 (executable)
index 0000000..2782158
--- /dev/null
@@ -0,0 +1,9 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-pglocal.cmd\r
+\r
+pg_ctl -w -m immediate -D %PGBASE%\data stop\r
+\r
+endlocal\r
+pause\r
diff --git a/bin/run-pgserver.cmd b/bin/run-pgserver.cmd
new file mode 100755 (executable)
index 0000000..f11b51b
--- /dev/null
@@ -0,0 +1,14 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-pglocal.cmd\r
+\r
+rem ### Start PostgreSQL in background\r
+rem ### Terminates after pause\r
+rem pg_ctl -D %PGBASE%\data -l %PGBASE%\data\startup.log start\r
+\r
+rem ### Start PostgreSQL in foreground\r
+postgres -D %PGBASE%\data\r
+\r
+endlocal\r
+pause\r
diff --git a/bin/start_py26.cmd b/bin/start_py26.cmd
new file mode 100755 (executable)
index 0000000..ed3cd75
--- /dev/null
@@ -0,0 +1,13 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-app.cmd\r
+\r
+set PATH=%PY26DIR%;%PY26DIR%\Scripts;%PATH%\r
+\r
+rem craete shortcut\r
+rem C:\Windows\System32\cmd.exe /A /Q /K %~0\r
+\r
+start "Python 2.6" /D %PY26DIR%\r
+\r
+endlocal\r
diff --git a/bin/start_py27.cmd b/bin/start_py27.cmd
new file mode 100755 (executable)
index 0000000..ae1ebd1
--- /dev/null
@@ -0,0 +1,13 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-app.cmd\r
+\r
+set PATH=%PY27DIR%;%PY27DIR%\Scripts;%PATH%\r
+\r
+rem craete shortcut\r
+rem C:\Windows\System32\cmd.exe /A /Q /K %~0\r
+\r
+start "Python 2.7" /D %PY27DIR%\r
+\r
+endlocal\r
diff --git a/bin/start_vagrant.cmd b/bin/start_vagrant.cmd
new file mode 100755 (executable)
index 0000000..e1b1cb9
--- /dev/null
@@ -0,0 +1,12 @@
+@echo off\r
+setlocal\r
+\r
+call %~dp0..\etc\env-app.cmd\r
+\r
+rem set PATH=%VAGRANTDIR%\bin;%PATH%\r
+\r
+rem C:\Windows\System32\cmd.exe /k cd %VAGRANTDIR% && C:\r
+\r
+start "Vagrant" /D %VAGRANTDIR%\r
+\r
+endlocal\r
diff --git a/doc/postgresql.md b/doc/postgresql.md
new file mode 100644 (file)
index 0000000..446d7f7
--- /dev/null
@@ -0,0 +1,26 @@
+PostgreSQLのバージョンが変わったら
+============================================================
+
+共通
+------------------------------------------------------------
+
+`env-pgbase.cmd`の`PGBASE`を編集する。
+
+
+新規の場合
+------------------------------------------------------------
+
+`PGDATA=%PGBASE%\data`
+
+1. DBクラスタの初期化 `run-pginit.cmd`
+2. サーバーの起動 `run-pgserver.cmd`
+3. DBの作成 `run-pgcreatedb.cmd`
+
+
+DBを引き継ぐ場合(マイナーアップデート)
+------------------------------------------------------------
+
+
+DBを引き継ぐ場合(メジャーアップデート)
+------------------------------------------------------------
+
diff --git a/doc/readme.md b/doc/readme.md
new file mode 100644 (file)
index 0000000..eea94f6
--- /dev/null
@@ -0,0 +1,67 @@
+README
+============================================================
+
+\83f\83B\83\8c\83N\83g\83\8a\8d\\90¬
+------------------------------------------------------------
+
+- bin
+- etc
+- doc
+
+- apache-ant-1.10.13
+
+  https://ant.apache.org/bindownload.cgi
+
+- apache-maven-3.9.1
+
+  https://maven.apache.org/download.cgi
+
+- apache-archiva-2.2.10
+
+  https://archiva.apache.org/download.cgi
+
+- apache-archiva-var
+
+- pgsql-15.2
+
+  https://www.enterprisedb.com/download-postgresql-binaries
+
+- jdk8u362-b09-jre
+
+  https://adoptium.net/temurin/releases
+
+
+\90Ý\92è\83t\83@\83C\83\8b
+------------------------------------------------------------
+
+- env-archiva.cmd
+
+  Apache Archiva
+
+- env-jre8.cmd
+
+  Java SE 8
+
+- env-pgbase.cmd
+
+  PostgreSQL
+
+- env-pglocal.cmd
+
+  PostgreSQL\82ð\83\8d\81[\83J\83\8b\82Å\8bN\93®\82·\82é\82½\82ß\82Ì\90Ý\92è
+
+- pgpwfile
+
+  PostgreSQL\83f\81[\83^\83x\81[\83X\82Ì\8f\89\8aú\8aÇ\97\9d\8eÒ\83p\83X\83\8f\81[\83h
+
+- env-app.cmd
+
+  Vagrant\81APython2.6\81APython2.7\82Ì\83p\83X
+
+- local-app.cmd
+
+  `env-app.cmd`\82Ì\8fã\8f\91\82«\90Ý\92è
+
+- env-proxy.cmd
+
+  \83v\83\8d\83L\83V\90Ý\92è
diff --git a/etc/env-app.cmd b/etc/env-app.cmd
new file mode 100644 (file)
index 0000000..afc945a
--- /dev/null
@@ -0,0 +1,9 @@
+@echo off\r
+\r
+set PY26DIR=%~dp0..\Python2.6\r
+set PY27DIR=%~dp0..\Python2.7\r
+set VAGRANTDIR=%~dp0..\Vagrant\r
+\r
+if exist %~dp0local-app.cmd (\r
+    call %~dp0local-app.cmd\r
+)\r
diff --git a/etc/env-archiva.cmd b/etc/env-archiva.cmd
new file mode 100644 (file)
index 0000000..69d1b39
--- /dev/null
@@ -0,0 +1,4 @@
+@echo off\r
+\r
+set ARCHIVA_HOME=%~dp0..\apache-archiva-2.2.10\r
+set ARCHIVA_BASE=%~dp0..\apache-archiva-var\r
diff --git a/etc/env-jre8.cmd b/etc/env-jre8.cmd
new file mode 100644 (file)
index 0000000..a302a97
--- /dev/null
@@ -0,0 +1,4 @@
+@echo off\r
+\r
+set JAVA_HOME=%~dp0..\jdk8u362-b09-jre\r
+set PATH=%JAVA_HOME%\bin;%PATH%\r
diff --git a/etc/env-pgbase.cmd b/etc/env-pgbase.cmd
new file mode 100644 (file)
index 0000000..c5b083e
--- /dev/null
@@ -0,0 +1,4 @@
+@echo off\r
+\r
+set PGBASE=%~dp0..\pgsql-15.2\r
+set PATH=%PGBASE%\bin;%PATH%\r
diff --git a/etc/env-pglocal.cmd b/etc/env-pglocal.cmd
new file mode 100644 (file)
index 0000000..f41348f
--- /dev/null
@@ -0,0 +1,8 @@
+@echo off\r
+\r
+call %~dp0env-pgbase.cmd\r
+\r
+set PGDATA=%PGBASE%\data\r
+set PGHOSTADDR=127.0.0.1\r
+set PGPORT=5432\r
+set PGUSER=postgres\r
diff --git a/etc/env-proxy.cmd b/etc/env-proxy.cmd
new file mode 100644 (file)
index 0000000..74b60cf
--- /dev/null
@@ -0,0 +1,7 @@
+@echo off\r
+\r
+rem set PROXYUSER=\r
+rem set PROXYPASS=\r
+rem set PROXYSERVER=proxy.example.com:8080\r
+rem set http_proxy=http://%PROXYUSER%:%PROXYPASS%@%PROXYSERVER%\r
+rem set https_proxy=http://%PROXYUSER%:%PROXYPASS%@%PROXYSERVER%\r
diff --git a/etc/pgpwfile b/etc/pgpwfile
new file mode 100644 (file)
index 0000000..bb55c59
--- /dev/null
@@ -0,0 +1 @@
+postgres\r