From ed620fc118aec84dff1820ea506dd377d0e02e2f Mon Sep 17 00:00:00 2001 From: eelti Date: Tue, 9 Mar 2021 22:42:23 -0500 Subject: [PATCH 1/6] add tenant wilbar and change to postgres 13.2 --- .env | 2 +- wilbar/.env | 17 +++++++++++++++++ wilbar/README.md | 7 +++++++ wilbar/lib/README.md | 3 +++ wilbar/packages/README.md | 3 +++ 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 wilbar/.env create mode 100644 wilbar/README.md create mode 100644 wilbar/lib/README.md create mode 100644 wilbar/packages/README.md diff --git a/.env b/.env index 2c3023d..1be7a5f 100755 --- a/.env +++ b/.env @@ -15,4 +15,4 @@ ADEMPIERE_DB_PORT=55432 ADEMPIERE_DB_PASSWORD=adempiere ADEMPIERE_DB_ADMIN_PASSWORD=postgres -PG_VERSION=12.2 +PG_VERSION=13.2 diff --git a/wilbar/.env b/wilbar/.env new file mode 100644 index 0000000..f187c6b --- /dev/null +++ b/wilbar/.env @@ -0,0 +1,17 @@ +# Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see .ce +# Email: victor.perez@e-evolution.com, http://www.e-evolution.com , http://github.com/e-Evolution +ADEMPIERE_WEB_PORT=8277 +ADEMPIERE_SSL_PORT=4447 +ADEMPIERE_VERSION=3.9.3 +# ATENTION If is "Y" it will be replace de actual defined database with a empty ADempiere seed +ADEMPIERE_DB_INIT=Y diff --git a/wilbar/README.md b/wilbar/README.md new file mode 100644 index 0000000..3482045 --- /dev/null +++ b/wilbar/README.md @@ -0,0 +1,7 @@ +#### tenant dierectory + +This directory contains the files needed to deploy and start a particular ADempiere instance of a tenant. +Here we will find: +* The Adempiere Adempiere_391LTS.tar.gz installer, if not exist then this will be download from the last stable version. +* lib: The files to copy to the lib directory on ADempiere (this directory will contain the customization and zkcustomization of ADempiere. +* packages: The files to copy to the packages directory on ADempiere (this directory will contain the localization of an ADempiere). \ No newline at end of file diff --git a/wilbar/lib/README.md b/wilbar/lib/README.md new file mode 100644 index 0000000..7a322f4 --- /dev/null +++ b/wilbar/lib/README.md @@ -0,0 +1,3 @@ +#### tenant dierectory lib + +This directory contains the lib files needed to deploy and start a particular ADempiere instance of a tenant. \ No newline at end of file diff --git a/wilbar/packages/README.md b/wilbar/packages/README.md new file mode 100644 index 0000000..299d4e3 --- /dev/null +++ b/wilbar/packages/README.md @@ -0,0 +1,3 @@ +#### tenant dierectory + +This directory contains the packages files needed to deploy and start a particular ADempiere instance of a tenant. \ No newline at end of file From 3233d5e3dfa4f21d988e1f02f64b6ff8f157c96d Mon Sep 17 00:00:00 2001 From: eelti Date: Wed, 2 Jun 2021 15:40:17 -0400 Subject: [PATCH 2/6] add copy customization.jar and xml --- adempiere-last/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adempiere-last/Dockerfile b/adempiere-last/Dockerfile index e8da7f7..e72ba67 100755 --- a/adempiere-last/Dockerfile +++ b/adempiere-last/Dockerfile @@ -25,7 +25,9 @@ ENV ADEMPIERE_HOME /opt/Adempiere ENV AD_DB_Init $AD_DB_Init COPY $ADEMPIERE_SRC_DIR/$ADEMPIERE_BINARY /tmp -COPY $ADEMPIERE_SRC_DIR/lib /tmp/lib +COPY $ADEMPIERE_SRC_DIR/lib/customization.jar /tmp/lib +COPY $ADEMPIERE_SRC_DIR/lib/zkcustomization.jar /tmp/lib +COPY $ADEMPIERE_SRC_DIR/migration/ /tmp/migration COPY $ADEMPIERE_SRC_DIR/packages /tmp/packages COPY ./adempiere-last/start-adempiere.sh /root COPY ./adempiere-last/define-ad-ctl.sh /root From 7608902b0f1eea0d94bfc037bd3e5ffea07753b5 Mon Sep 17 00:00:00 2001 From: eelti Date: Sun, 6 Jun 2021 22:09:59 -0400 Subject: [PATCH 3/6] Translate application.sh to powerShell to be able to run in a windows machine in docker desktop --- adempiere-last/Dockerfile | 8 +-- application.ps1 | 137 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 4 deletions(-) create mode 100644 application.ps1 diff --git a/adempiere-last/Dockerfile b/adempiere-last/Dockerfile index e72ba67..6abc11c 100755 --- a/adempiere-last/Dockerfile +++ b/adempiere-last/Dockerfile @@ -25,8 +25,7 @@ ENV ADEMPIERE_HOME /opt/Adempiere ENV AD_DB_Init $AD_DB_Init COPY $ADEMPIERE_SRC_DIR/$ADEMPIERE_BINARY /tmp -COPY $ADEMPIERE_SRC_DIR/lib/customization.jar /tmp/lib -COPY $ADEMPIERE_SRC_DIR/lib/zkcustomization.jar /tmp/lib +COPY $ADEMPIERE_SRC_DIR/lib/ /tmp/lib COPY $ADEMPIERE_SRC_DIR/migration/ /tmp/migration COPY $ADEMPIERE_SRC_DIR/packages /tmp/packages COPY ./adempiere-last/start-adempiere.sh /root @@ -35,8 +34,9 @@ COPY ./adempiere-last/define-ad-ctl.sh /root RUN cd /tmp && \ tar zxvf /tmp/$ADEMPIERE_BINARY && \ mv Adempiere /opt/Adempiere && \ -mv lib /opt/Adempiere/lib && \ -mv packages /opt/Adempiere/packages && \ +mv /tmp/lib /opt/Adempiere/lib && \ +mv /tmp/packages /opt/Adempiere/packages && \ +mv /tmp/migration /opt/Adempiere/migration && \ chmod -Rf 755 /opt/Adempiere/*.sh && \ chmod -Rf 755 /opt/Adempiere/utils/*.sh && \ diff --git a/application.ps1 b/application.ps1 new file mode 100644 index 0000000..276e8ce --- /dev/null +++ b/application.ps1 @@ -0,0 +1,137 @@ +# Copyright (C) 2021,eelti. , http://eelti.ca +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# This is a portal of the bash script from http://www.e-evolution.com , http://github.com/e-Evolution +# Email: eriled@gmail.com, http://github.com/eelti + +$BASE_DIR=Get-Location + +if (!$args[0]){ + Write-Output "ADempiere instance name, should use application.sh up -d " + exit 1 +} + +# load environment variables +$regex='(?!"#")' +foreach($line in Get-Content ./.env){ + $va=$line -split('=') + # New-Variable -Name $va[0] -Value $va[1] -Scope + [Environment]::SetEnvironmentVariable($va[0], $va[1]) +} +Write-Output $env:ADEMPIERE_DB_PORT + +#export COMPOSE_PROJECT_NAME=$1; +[Environment]::SetEnvironmentVariable("COMPOSE_PROJECT_NAME", $args[0]) +Write-Output "Instance $env:COMPOSE_PROJECT_NAME" +#. ./$COMPOSE_PROJECT_NAME/.env +foreach($line in Get-Content ./$env:COMPOSE_PROJECT_NAME/.env){ + $va=$line -split('=') + # New-Variable -Name $va[0] -Value $va[1] -Scope + [Environment]::SetEnvironmentVariable($va[0], $va[1]) +} + +if (!$env:ADEMPIERE_WEB_PORT){ + Write-Output "ADempiere HTTP port not setting" + exit 1 +} + + +if (!$env:ADEMPIERE_SSL_PORT){ + Write-Output "ADempiere HTTPS port not setting" + exit 1 +} + +if (!$env:ADEMPIERE_DB_INIT){ + Write-Output "Initialize Database not setting" + exit 1 +} + +if (!$env:ADEMPIERE_VERSION){ + Write-Output "ADempiere version not setting" + exit 1 +} + +# export ADEMPIERE_WEB_PORT; +# export ADEMPIERE_SSL_PORT; +# export ADEMPIERE_DB_INIT; + +Write-Output "ADempiere HTTP port: $env:ADEMPIERE_WEB_PORT" +Write-Output "ADempiere HTTPS port: $env:ADEMPIERE_SSL_PORT" +Write-Output "Initialize Database $env:ADEMPIERE_DB_INIT" + + +if ((docker network inspect -f '{{.Name}}' custom) -ne "custom"){ + Write-Output "Create custom network" + docker network create -d bridge custom +} + +$PG_VERSION = "$env:PG_VERSION".Replace(".",'') +#$env:PG_VERSION = $PG_VERSION +Write-Output "$PG_VERSION" +Write-Output $env:PG_VERSION + +$RUNNING=docker inspect --format="{{.State.Running}}" postgres"$env:PG_VERSION"_db_1 +if ($RUNNING -eq ""){ + Write-Output "Dababase container does not exist." + Write-Output "Create Database container" + docker-compose -f "$BASE_DIR/database.yml" -f "$BASE_DIR/database.volume.yml" -p postgres$env:PG_VERSION up -d +} + +if ($RUNNING -eq "false"){ + Write-Output "CRITICAL - postgres"$env:PG_VERSION"_db_1 is not running." + Write-Output "Starting Database" + docker-compose -f "$BASE_DIR/database.yml" -f "$BASE_DIR/database.volume.yml" -p postgres$env:PG_VERSION start +} + +if ($RUNNING -eq "true"){ + docker-compose -f "$BASE_DIR/database.yml" -f "$BASE_DIR/database.volume.yml" -p postgres$env:PG_VERSION config +} + + +# Define Adempiere path and binary +$ADEMPIERE_PATH="$BASE_DIR\$env:COMPOSE_PROJECT_NAME" +Write-Output $ADEMPIERE_PATH +$ADEMPIERE_BINARY="Adempiere_" + $env:ADEMPIERE_VERSION.Replace(".",'') + "LTS.tar.gz" +[Environment]::SetEnvironmentVariable("ADEMPIERE_BINARY", $ADEMPIERE_BINARY) +#export ADEMPIERE_BINARY; +$URL="https://github.com/adempiere/adempiere/releases/download/" + $env:ADEMPIERE_VERSION + "/" + $ADEMPIERE_BINARY +#$URL="https://github.com/adempiere/adempiere/releases/download/3.9.3/Adempiere_393LTS.tar.gz" + +if (Test-Path -Path $ADEMPIERE_PATH){ + if (Test-Path -LiteralPath $ADEMPIERE_PATH/$ADEMPIERE_BINARY){ + Write-Output "Installed based on ADempiere $ADEMPIERE_VERSION" + } + else + { + Write-Output "Adempiere Path $ADEMPIERE_PATH" + Write-Output "Adempiere Version $env:ADEMPIERE_VERSION" + Write-Output "Adempiere Binary $ADEMPIERE_PATH\$ADEMPIERE_BINARY" + Write-Output "Download from $URL" + #curl -L $URL > "$ADEMPIERE_PATH/$ADEMPIERE_BINARY" + Invoke-RestMethod -Uri $URL -OutFile "$ADEMPIERE_PATH\$ADEMPIERE_BINARY" + if (Test-Path -LiteralPath $ADEMPIERE_PATH/$ADEMPIERE_BINARY){ + Write-Output "Adempiere Binary download successful" + } + else{ + Write-Output "Adempiere Binary not download" + exit + } + + } + + # Execute docker-compose + #docker-compose -f "$BASE_DIR\adempiere.yml" -p "$env:COMPOSE_PROJECT_NAME" $args[1] $args[2] $args[3] $args[4] + Write-Output $args[0] $args[1] $args[2] $args[3] $args[4] + docker-compose -f $BASE_DIR"\adempiere.yml" -p $args[0] $args[1] $args[2] $args[3] $args[4] +} +else{ + Write-Output "Project directory not found for : $env:COMPOSE_PROJECT_NAME " +} \ No newline at end of file From 20934560abf2a57de3291c37d0d628bdd78bb5ac Mon Sep 17 00:00:00 2001 From: eelti Date: Sun, 6 Jun 2021 22:18:34 -0400 Subject: [PATCH 4/6] add file to .gitignore --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cd36b2d..cf63cac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ postgresql/dist/Adempiere* - +wilbar/* +wilbar +eevolution/migration/ZWG_0.1 +*.tar.gz +*.iml \ No newline at end of file From e40bbf3b4d80ba72ff39780a5d37b9df7eb49de1 Mon Sep 17 00:00:00 2001 From: Eric Leduc Date: Sun, 6 Jun 2021 22:22:25 -0400 Subject: [PATCH 5/6] Delete wilbar directory --- wilbar/.env | 17 ----------------- wilbar/README.md | 7 ------- wilbar/lib/README.md | 3 --- wilbar/packages/README.md | 3 --- 4 files changed, 30 deletions(-) delete mode 100644 wilbar/.env delete mode 100644 wilbar/README.md delete mode 100644 wilbar/lib/README.md delete mode 100644 wilbar/packages/README.md diff --git a/wilbar/.env b/wilbar/.env deleted file mode 100644 index f187c6b..0000000 --- a/wilbar/.env +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see .ce -# Email: victor.perez@e-evolution.com, http://www.e-evolution.com , http://github.com/e-Evolution -ADEMPIERE_WEB_PORT=8277 -ADEMPIERE_SSL_PORT=4447 -ADEMPIERE_VERSION=3.9.3 -# ATENTION If is "Y" it will be replace de actual defined database with a empty ADempiere seed -ADEMPIERE_DB_INIT=Y diff --git a/wilbar/README.md b/wilbar/README.md deleted file mode 100644 index 3482045..0000000 --- a/wilbar/README.md +++ /dev/null @@ -1,7 +0,0 @@ -#### tenant dierectory - -This directory contains the files needed to deploy and start a particular ADempiere instance of a tenant. -Here we will find: -* The Adempiere Adempiere_391LTS.tar.gz installer, if not exist then this will be download from the last stable version. -* lib: The files to copy to the lib directory on ADempiere (this directory will contain the customization and zkcustomization of ADempiere. -* packages: The files to copy to the packages directory on ADempiere (this directory will contain the localization of an ADempiere). \ No newline at end of file diff --git a/wilbar/lib/README.md b/wilbar/lib/README.md deleted file mode 100644 index 7a322f4..0000000 --- a/wilbar/lib/README.md +++ /dev/null @@ -1,3 +0,0 @@ -#### tenant dierectory lib - -This directory contains the lib files needed to deploy and start a particular ADempiere instance of a tenant. \ No newline at end of file diff --git a/wilbar/packages/README.md b/wilbar/packages/README.md deleted file mode 100644 index 299d4e3..0000000 --- a/wilbar/packages/README.md +++ /dev/null @@ -1,3 +0,0 @@ -#### tenant dierectory - -This directory contains the packages files needed to deploy and start a particular ADempiere instance of a tenant. \ No newline at end of file From 61d3b744484eb78b916f253b375324c9a9bc1143 Mon Sep 17 00:00:00 2001 From: eelti Date: Sun, 6 Jun 2021 22:29:50 -0400 Subject: [PATCH 6/6] add migration directory --- eevolution/migration/Readme.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 eevolution/migration/Readme.txt diff --git a/eevolution/migration/Readme.txt b/eevolution/migration/Readme.txt new file mode 100644 index 0000000..e69de29