diff --git a/.github/actions/adempiere-build/action.yml b/.github/actions/adempiere-build/action.yml index d6003472e5..37883df0d1 100644 --- a/.github/actions/adempiere-build/action.yml +++ b/.github/actions/adempiere-build/action.yml @@ -1,15 +1,16 @@ name: 'ADempiere Build' -description: 'ADempiere is built and installed. Database seed is generated only if a nigration xml file was modified' +description: 'ADempiere is built and installed. Database seed is generated only if a migration xml file was modified' author: 'Mario Calderon, marcalwestf' inputs: - nodbrestore: # id of input - description: 'true-> no restore of DB; false-> DB will be restored' + nodbrestore: # input parameter ID + description: 'Value of nodbrestore==true -> no restore of DB. Value of nodbrestore==false-> DB will be restored' required: true default: "true" runs: using: "composite" steps: - run: | + echo "Start from action adempiere-build/action.yml" echo $ACTION_BUILD_DIR echo $GITHUB_REF echo $GITHUB_HEAD_REF @@ -27,7 +28,11 @@ runs: echo $(ant -version)name: Build, install and restore echo $ADEMPIERE_HOME - # ANT performs build & install. If parameter nodbrestore=false, it performs also a database restore. + echo "End from action adempiere-build/action.yml" + echo "Control gets over to $ADEMPIERE_HOME/build.xml" + echo "The call is: ant build -Dnodbrestore=${{ inputs.nodbrestore }}" + # ANT performs build & install. + # If parameter nodbrestore=false, it performs also a database restore; otherwise, the database restore is skipped. ant build -Dnodbrestore=${{ inputs.nodbrestore }} env: ACTION_BUILD_DIR: ${{ github.action_path }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f6dc12459b..2bdfa66b93 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,14 +19,14 @@ jobs: build-all: # The type of runner that the job will run on # For Linux, only Ubuntu is supported. - # Taking a specific version number to avoid side effects. + # Taking the last version. runs-on: ubuntu-latest # Service containers to run with `container-job` services: # Label used to access the service container postgres: # Docker Hub image - # Ubuntu lates with last version of postgresql + # Take the specific latest Postgres version that runs with latest Ubuntu version. image: postgres:14.6 # Provide the password for postgres env: @@ -67,6 +67,7 @@ jobs: echo "Installing Tomcat version 9 FINISHED" # Filter files to discern whether to run with or without database restore + # Restore due when following files are modified: migration xml files, Github action files and utils scripts. - name: Discern which files changed ... uses: dorny/paths-filter@v2 id: changed-files @@ -74,6 +75,9 @@ jobs: filters: | xml-files: - 'migration/**/*.xml' + - '.github/workflows/*.yml' + - 'build.xml' + - 'utils/RUN*.*' # Build ADempiere with ant, if there are changes in XML files - name: Build Adempiere with database restore... diff --git a/build.xml b/build.xml index fd50b7003a..d9f9b8120e 100644 --- a/build.xml +++ b/build.xml @@ -53,7 +53,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -83,49 +83,34 @@ + - + - - + + - - - - - - - + - + + - - - + - + diff --git a/utils/PostgreSQL/DBRestore.sh b/utils/PostgreSQL/DBRestore.sh index dd79c8999e..317dad72d9 100644 --- a/utils/PostgreSQL/DBRestore.sh +++ b/utils/PostgreSQL/DBRestore.sh @@ -2,7 +2,7 @@ echo ADempiere Database Import -echo Importing ADempiere DB from $ADEMPIERE_HOME/data/Adempiere_pg.dmp +echo Importing ADempiere DB from $ADEMPIERE_HOME/data/ExpDat.dmp if [ $# -le 2 ] then @@ -42,9 +42,9 @@ echo ------------------------------------- echo Import Adempiere_pg.dmp echo ------------------------------------- psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -d $ADEMPIERE_DB_NAME -U $2 -c "drop schema sqlj cascade" -ADEMPIERE_ALTER_ROLE_SQL="ALTER ROLE $2 SET search_path TO adempiere, pg_catalog" +ADEMPIERE_ALTER_ROLE_SQL="ALTER ROLE $2 SET search_path TO $ADEMPIERE_DB_NAME, pg_catalog" psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -d $ADEMPIERE_DB_NAME -U $2 -c "$ADEMPIERE_ALTER_ROLE_SQL" -psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -d $ADEMPIERE_DB_NAME -U $2 -f $ADEMPIERE_HOME/data/Adempiere_pg.dmp +psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -d $ADEMPIERE_DB_NAME -U $2 -f $ADEMPIERE_HOME/data/ExpDat.dmp PGPASSWORD= export PGPASSWORD diff --git a/utils/RUN_DBRestore.sh b/utils/RUN_DBRestore.sh index b26aa89034..f805ca4873 100644 --- a/utils/RUN_DBRestore.sh +++ b/utils/RUN_DBRestore.sh @@ -8,9 +8,9 @@ fi echo Restore Adempiere Database from Export- $ADEMPIERE_HOME \($ADEMPIERE_DB_NAME\) -echo Re-Create Adempiere User and import $ADEMPIERE_HOME/data/Adempiere_pg.dmp +echo Re-Create Adempiere User and import $ADEMPIERE_HOME/data/ExpDat.dmp echo == The import will show warnings. This is OK == -ls -lsa $ADEMPIERE_HOME/data/Adempiere_pg.dmp +ls -lsa $ADEMPIERE_HOME/data/ExpDat.dmp echo Press enter to continue ... read in