Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/maven/src/commons-io-commons-io…
Browse files Browse the repository at this point in the history
…-2.7
  • Loading branch information
offtherailz authored Jul 10, 2024
2 parents 6ed9518 + be62769 commit ec53a06
Show file tree
Hide file tree
Showing 447 changed files with 25,083 additions and 11,086 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: CI

on:
push:
branches:
- master
- '[0-9]+.[0-9]+*'
pull_request:
branches:
- master
- '[0-9]+.[0-9]+*'

jobs:
# Run build and test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B clean install -Pextjs,h2_disk,auditing
## Only on push event, publish on geosolutions maven repo
publish:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.repository == 'geosolutions-it/geostore' }}
needs: build
concurrency: ci-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: geosolutions
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn clean install deploy -Ppostgres,extjs
env:
MAVEN_USERNAME: ${{ secrets.GS_MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.GS_MAVEN_PASSWORD }}
64 changes: 64 additions & 0 deletions .github/workflows/cut-major-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Cut Release Branch
on:
workflow_dispatch:
inputs:
current-version:
description: Current version (e.g. 2.1)
required: true
next-version:
description: Next version (e.g. 2.2).
required: true
main-branch:
description: main branch
default: master
pr-options:
description: Options for Pull request
default: --squash --auto --delete-branch
jobs:
cut-release:
name: Create release branch and PRs into main main branch
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2
with:
ref: master
- name: Create release branch and generate PR body
id: create-branch
env:
CURR: ${{ github.event.inputs.current-version }}
NEXT: ${{ github.event.inputs.next-version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAIN_BRANCH: ${{ github.event.inputs.main-branch }}
PR_OPTIONS: ${{ github.event.inputs.pr-options }}
RUN_ID: ${{ github.run_id }}

run: |
# script will go here
echo "Initializing git"
# Optional
git config user.name github-actions
git config user.email github-actions@github.com
BRANCH_NAME="${CURR}.x"
echo "creating branch is $BRANCH_NAME"
git checkout -b "$BRANCH_NAME"
git push --set-upstream origin "$BRANCH_NAME"
echo "branch created"
echo "creating bump changes"
git checkout "$MAIN_BRANCH"
mvn -q -B release:update-versions -DautoVersionSubmodules=true -DdevelopmentVersion=${NEXT}-SNAPSHOT # sets the internal verison
mvn -q -B versions:set-property -B -Dproperty=geostore-version -DnewVersion=${NEXT}-SNAPSHOT # sets geostore-version property
pr_branch_name="bump-${NEXT}-${RUN_ID}"
echo "Creating a temp PR on branch: ${pr_branch_name}"
git checkout -b "${pr_branch_name}"
find . -name 'pom.xml' | xargs git add
git commit -m "Bump version to ${NEXT}"
git push origin "${pr_branch_name}"
pr_url=$(gh pr create -B "${MAIN_BRANCH}" -H "${pr_branch_name}" --title "[github-action] Bump version to ${NEXT}" --body "This automatic pull request bumps version of ${MAIN_BRANCH} branch to ${NEXT}")
sleep 10
gh pr merge "$pr_url" ${PR_OPTIONS}
97 changes: 97 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version to release, e.g. 2.1.0 (make sure to execute on this on the release branch)'
required: true
base:
description: 'Base Version. e.g. 2.1'
required: true

jobs:
fix-version:
# if: ${{ github.repository == 'geosolutions-it/geostore' && github.ref != 'master' }}
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Check branch
if: ${{ github.repository != 'geosolutions-it/geostore' || github.ref == 'master' }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('This workflow can not run on master branch')
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: maven

- name: Fix versions, commit and push new tag
run: |
# fix versions to ${{ inputs.version }}
mvn versions:set -DnewVersion=${{ inputs.version }} -DgenerateBackupPoms=false # set versions
mvn versions:set-property -Dproperty=geostore-version -DnewVersion=${{ inputs.version }} # set geostore-version property
mvn versions:use-releases # check to not use SNAPSHOTs
# script will go here
echo "Initializing git"
# Optional
git config user.name github-actions
git config user.email github-actions@github.com
# Commit changes
find . -name 'pom.xml' | xargs git add
git commit -m "Version Release ${{ inputs.version }}"
git tag v${{ inputs.version }} # create tag
git push origin ${{ github.ref_name }} --tags
- name: Build with Maven
run: mvn -B clean install -Pextjs,h2_disk,auditing

- name: Set up Maven Repository
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: geosolutions
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Publish package
run: mvn clean install deploy -Ppostgres,extjs
env:
MAVEN_USERNAME: ${{ secrets.GS_MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.GS_MAVEN_PASSWORD }}
- name: Restore Snapshots
run: |
# restore versions to ${{ inputs.base }}-SNAPSHOT
mvn versions:set -DnewVersion=${{ inputs.base }}-SNAPSHOT -DgenerateBackupPoms=false
mvn versions:set-property -Dproperty=geostore-version -DnewVersion=${{ inputs.base }}-SNAPSHOT # set geostore-version property
find . -name 'pom.xml' | xargs git add
git commit -m "Restore snapshots from ${{ inputs.version }} to ${{ inputs.base }}-SNAPSHOT"
git tag ${VERSION} # create tag
git push origin ${{ github.ref_name }}
echo "Snapshots version restored"
release:
runs-on: ubuntu-latest
needs: fix-version
concurrency: release-${{ github.ref }}
steps:
- name: create_release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: "v${{ inputs.version }}"
name: "${{ inputs.version }}"
generate_release_notes: true
draft: false
prerelease: false
68 changes: 54 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Build Status](https://travis-ci.org/geosolutions-it/geostore.svg?branch=master)](https://travis-ci.org/geosolutions-it/geostore)
[![Build Status](http://build.geo-solutions.it/jenkins/buildStatus/icon?job=GeoStore-Master)](http://build.geo-solutions.it/jenkins/job/GeoStore-Master)
![Build Status](https://github.com/geosolutions-it/geostore/actions/workflows/CI.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/geosolutions-it/geostore/badge.svg?branch=master)](https://coveralls.io/github/geosolutions-it/geostore?branch=master)

[GeoStore](https://github.com/geosolutions-it/geostore) is an open source Java enterprise application for storing, searching and retrieving data on the fly.
Expand All @@ -8,25 +7,66 @@ GeoStore performs authentication internally (auth framework shall be pluggable),

A comprehensive [REST API](https://github.com/geosolutions-it/geostore/wiki/REST-API) allows an easy handling of internal resources, so that client side applications can easily query the store, while remote server side application can integrate with GeoStore using the GeoStoreClient, an utility java class that hides the REST communications complexities.

Documentation
-------------
# Documentation

For more information check the [GeoStore wiki](https://github.com/geosolutions-it/geostore/wiki/Documentation-index) .

License
------------
## Release process

The release procedure is essentially made of 2 steps:
- **Cut major branch**
- Effective **Release**

The project is developed on the main (master) branch, containing the latest `-SNAPSHOT` version of the modules of the project. When a major release starts the validation process, a new *release branch* is created (see [Cut-Release](#cut-Release-branch), named `<major-version>.xx`.
After this on the main (master) branch the `-SNAPSHOT` version of the modules is increased and from this point the main branch will include commits for the next major version of the project.

When the validation process is completed and all the fixes have been applied to the *release branch*, the version of the java modules is fixed, commit is tagged with the number of the release and the Github *release* is published. See [Release](#release).

After this on the *release brach* the `-SNAPSHOT` version of the modules is restored so that it is possible to continue applying fixes and minor improvements, creating more releases on it with the same procedure, until end of maintainance.

Here the steps to follow for executing the 2 procedures :

### Cut-Release branch

1. Run the workflow [Cut Release branch](../../actions/workflows/cut-major-branch.yml) passing
- Branch Master
- current version
- next version
- main branch (keep `master`)
- other options (can be left as default)
2. Merge the PR that is generated, if not merged automatically

### Release

1. Run the workflow [Release](../../actions/workflows/release.yml) with the folling parameters:
- select the branch to use (e.g. `2.1.x`)
- version to release (e.g. `2.1.0`)
- base version (e.g. `2.1`)

The release will be automatically published on GitHub. Packages will be automatically deployed on maven repository.


## Relevant Workflows

- [CI](../../actions/workflows/CI.yml): Automatically does tests for pull request or commits on `master`. For commits on the main repo (e.g. when PR are merged on `master` or stable branches, the workflow publish also the artifacts on [GeoSolutions Maven Repository](https://maven.geo-solutions.it)
- **[Cut release branch](../../actions/workflows/cut-major-branch.yml)**: (`cut-major-branch.yml`): Manually triggered workflow that allows to create a stable branch named `<current-version>.x` and create a pull request for updating `master` branch `-SNAPSHOT` version with the new data.
- **[Release](../../actions/workflows/release.yml)**: (`cut-major-branch.yml`): Manually triggered workflow to apply to the stable branch that fixes the maven modules versions, tags the commit, build and deploy artifacts, restores snapshot versions and publish a Github release on the tagged commit.

# License

**GeoStore** core modules are free and Open Source software, released under the [GPL v3](http://www.gnu.org/licenses/gpl.html) license.

Professional Support
---------------------
# Professional Support

GeoStore is being developed by [GeoSolutions](http://www.geo-solutions.it/) hence you can talk to us for professional support. Anyway the project is a real Open Source project hence you can contribute to it (see section below).

Contributing
---------------------
# Contributing

We welcome contributions in any form:

* pull requests for new features
* pull requests for bug fixes
* pull requests for documentation
* funding for any combination of the above
- pull requests for new features
- pull requests for bug fixes
- pull requests for documentation
- funding for any combination of the above


18 changes: 8 additions & 10 deletions doc/sql/001_setup_db.sql
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
-- CREATE SCHEMA geostore
CREATE user geostore LOGIN PASSWORD 'geostore' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
CREATE USER geostore LOGIN PASSWORD 'geostore' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;

CREATE SCHEMA geostore;

GRANT USAGE ON SCHEMA geostore TO geostore ;
GRANT ALL ON SCHEMA geostore TO geostore ;

--GRANT SELECT ON public.spatial_ref_sys to geostore;
--GRANT SELECT,INSERT,DELETE ON public.geometry_columns to geostore;
GRANT SELECT ON public.spatial_ref_sys to geostore;
GRANT SELECT,INSERT,DELETE ON public.geometry_columns to geostore;

alter user geostore set search_path to geostore , public;
ALTER USER geostore SET search_path TO geostore , public;

-- CREATE SCHEMA georepo_test
CREATE user geostore_test LOGIN PASSWORD 'geostore_test' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
CREATE USER geostore_test LOGIN PASSWORD 'geostore_test' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;

CREATE SCHEMA geostore_test;

GRANT USAGE ON SCHEMA geostore_test TO geostore_test;
GRANT ALL ON SCHEMA geostore_test TO geostore_test;

--GRANT SELECT ON public.spatial_ref_sys to geostore_test;
--GRANT SELECT,INSERT,DELETE ON public.geometry_columns to geostore_test;
GRANT SELECT ON public.spatial_ref_sys to geostore_test;
GRANT SELECT,INSERT,DELETE ON public.geometry_columns to geostore_test;

alter user geostore_test set search_path to geostore_test, public;
ALTER USER geostore_test SET search_path TO geostore_test, public;
19 changes: 19 additions & 0 deletions doc/sql/002_create_schema_oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
metadata varchar2(4000 char),
name varchar2(255 char) not null,
category_id number(19,0) not null,
creator varchar2(255 char),
editor varchar2(255 char),
advertised bool not null default true,
primary key (id),
unique (name)
);
Expand Down Expand Up @@ -72,6 +75,14 @@
unique (name, user_id)
);

create table gs_user_group_attribute (
id number(19,0) not null,
name varchar2(255 char) not null,
string varchar2(255 char),
userGroup_id number(19,0) not null,
primary key (id)
);

create table gs_usergroup (
id number(19,0) not null,
groupName varchar2(255 char) not null,
Expand Down Expand Up @@ -191,6 +202,14 @@
foreign key (user_id)
references gs_user;

create index idx_user_group_attr_name on gs_user_group_attribute (name);

create index idx_user_group_attr_text on gs_user_group_attribute (string);

create index idx_attr_user_group on gs_user_group_attribute (userGroup_id);

alter table gs_user_group_attribute add constraint fk_ugattrib_user_group foreign key (userGroup_id) references gs_usergroup;

create index idx_usergroup_name on gs_usergroup (groupName);

create sequence hibernate_sequence;
Loading

0 comments on commit ec53a06

Please sign in to comment.