Skip to content

Commit

Permalink
[geo2france] Apply customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Feb 2, 2024
1 parent d2aba56 commit 796301b
Show file tree
Hide file tree
Showing 8 changed files with 1,213 additions and 107 deletions.
10 changes: 10 additions & 0 deletions .github/resources/m2-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>artifactory-georchestra</id>
<mirrorOf>*</mirrorOf>
<url>https://artifactory.georchestra.org/artifactory/maven</url>
</mirror>
</mirrors>
</settings>
111 changes: 111 additions & 0 deletions .github/workflows/geonetwork-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: CI

env:
# Note: Only used to tag the docker image
GEORCHESTRA_VERSION: gn4.2.x

on:
push:
workflow_dispatch:
branches:
- georchestra-gn4.2.x-geo2france

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- name: "Checking out"
uses: actions/[email protected]
with:
submodules: 'recursive'

- name: "Checking out geOrchestra (needed for building testcontainers)"
uses: actions/[email protected]
with:
repository: "georchestra/georchestra"
path: "georchestra"
ref: "master"

- name: Saving start date
run: |
date +%s%3N > start
- name: "Setting up Java"
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'

- name: "Configuring Maven"
run: |
mkdir -p $HOME/.m2
cp .github/resources/m2-settings.xml $HOME/.m2/settings.xml
- name: "Installing the geOrchestra root pom"
run: |
mvn install --non-recursive -f georchestra/pom.xml
- name: "Installing testcontainers georchestra module"
run: |
mvn clean install -f georchestra/testcontainers/pom.xml
- name: "Installing georchestra commons module"
run: |
mvn clean install -f georchestra/commons/pom.xml
- name: "Installing security-proxy-spring-integration georchestra module"
run: |
mvn clean install -f georchestra/security-proxy-spring-integration/pom.xml
- name: "Installing GeoNetwork"
run: mvn clean install -DskipTests

- name: "Building docker image"
working-directory: web/
run: mvn clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=ghcr.io/camptocamp/georchestra-geo2france-configuration/geonetwork:${{ env.GEORCHESTRA_VERSION }}-${GITHUB_RUN_ID} -DskipTests

- name: "Login onto ghcr.io"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: 'c2c-bot-gis-ci'
password: '${{ secrets.GOPASS_CI_GITHUB_TOKEN }}'

- name: "Pushing image to ghcr.io"
run: |
docker push ghcr.io/camptocamp/georchestra-geo2france-configuration/geonetwork:${{ env.GEORCHESTRA_VERSION }}-${GITHUB_RUN_ID}
- name: "Slack notification"
uses: slackapi/[email protected]
with:
channel-id: 'CFQMVL8BG'
payload: |
{
"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

- name: "Publish a google-calendar event"
if: success()
uses: pmauduit/google-calendar-action@v1
with:
OAUTH_CLIENT_ID: '${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}'
OAUTH_CLIENT_SECRET: '${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}'
OAUTH_ACCESS_TOKEN: '${{ secrets.GOOGLE_OAUTH_ACCESS_TOKEN }}'
OAUTH_REFRESH_TOKEN: '${{ secrets.GOOGLE_OAUTH_REFRESH_TOKEN }}'
GCAL_ID: 'camptocamp.com_mpbq7llrcthk5qmmc0mkq7mlo0@group.calendar.google.com'
GCAL_EVENT_SUMMARY: 'Github actions - ${{ github.repository }}'
GCAL_EVENT_DESCRIPTION: "Image ghcr.io/camptocamp/georchestra-geo2france-configuration/geonetwork:${{ env.GEORCHESTRA_VERSION }}-${{ github.run_id }} built"
Loading

0 comments on commit 796301b

Please sign in to comment.