Skip to content

Commit

Permalink
refactoring for usage of AGnet maven repository
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierlemee committed Jun 19, 2024
1 parent 9195b82 commit 17d6d66
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 129 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check-project-integration-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
ARTIFACT_VERSION: ${{ inputs.package_release_name }}
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_ACCESS_ACCOUNT }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_ACCESS_TOKEN }}
MAVEN_USERNAME: ${{ secrets.SPACE_CYBNITY_OS_REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SPACE_CYBNITY_OS_REPO_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.AGNET_REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.AGNET_REPO_PASSWORD }}
steps:
- name: Checkout source codes from branch to verify
uses: actions/checkout@v4
Expand All @@ -32,12 +32,12 @@ jobs:
ref: ${{ inputs.config-path }}

- name: Set up Java for conformity checks
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: space-cybnity-open-source
server-id: agnet
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check-project-technical-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
ARTIFACT_VERSION: ${{ inputs.package_release_name }}
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_ACCESS_ACCOUNT }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_ACCESS_TOKEN }}
MAVEN_USERNAME: ${{ secrets.SPACE_CYBNITY_OS_REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SPACE_CYBNITY_OS_REPO_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.AGNET_REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.AGNET_REPO_PASSWORD }}
steps:
- name: Checkout source codes from branch to verify
uses: actions/checkout@v4
Expand All @@ -32,12 +32,12 @@ jobs:
ref: ${{ inputs.config-path }}

- name: Set up Java for conformity checks
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: space-cybnity-open-source
server-id: agnet
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/java-project-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ on:
# becarefull, path filters are not evaluated on tags
paths:
- 'pom.xml'
- 'implementation-line/**'
- 'implementations-line/**'
- 'systems-line/**'
- '.github/workflows/java-project-ci.yml'
- '.github/workflows/check-project-technical-quality.yml'
- '.github/workflows/publish-java-packages-version-to-repository.yml'
Expand Down Expand Up @@ -81,7 +82,7 @@ jobs:
# Build specific release name because none tag is existing on GitHub project
- name: Define reusable environment variables about current commit
if: ${{ env.TAG_VERSION == '' }}
uses: FranzDiebold/github-env-vars-action@v2.8.0
uses: FranzDiebold/github-env-vars-action@v2

- name: Define an unique revision name (pattern <<feature branch name>>.<<commit id abbrev>>) regarding development release
if: ${{ env.TAG_VERSION == '' }}
Expand Down Expand Up @@ -120,8 +121,10 @@ jobs:
RELEASE_NAME: ${{ needs.define_project_release_name.outputs.release_name }}
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_ACCESS_ACCOUNT }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_ACCESS_TOKEN }}
MAVEN_USERNAME: ${{ secrets.SPACE_CYBNITY_OS_REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SPACE_CYBNITY_OS_REPO_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.AGNET_REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.AGNET_REPO_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
outputs:
release_name: ${{ env.RELEASE_NAME }}
steps:
Expand All @@ -134,15 +137,24 @@ jobs:
ref: ${{ inputs.branch_name }}

- name: Set up java runtime (Temurin JDK)
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
# defined settings.xml values allowing use of CYBNITY Maven remote repository
server-id: space-cybnity-open-source
server-id: agnet
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value (without an modification than exported by the gpg --export-secret-keys command) of the GPG private key (33105BFD367D25B3) to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Install gpg secret key used for artefacts signing
run: |
# Install gpg secret key
cat <(echo -e "${{ secrets.MAVEN_GPG_PRIVATE_KEY }}") | gpg --batch --import
# Verify gpg secret key
gpg --list-secret-keys --keyid-format LONG
- name: Validate all necessary information and compile source code
run: |
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/publish-java-packages-version-to-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ jobs:
ARTIFACT_VERSION: ${{ inputs.package_release_name }}
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_ACCESS_ACCOUNT }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_ACCESS_TOKEN }}
MAVEN_USERNAME: ${{ secrets.SPACE_CYBNITY_OS_REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SPACE_CYBNITY_OS_REPO_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.AGNET_REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.AGNET_REPO_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
steps:
- name: Checkout source codes from branch to publish
uses: actions/checkout@v4
Expand All @@ -37,26 +39,29 @@ jobs:
token: ${{ github.token }}
ref: ${{ inputs.config-path }}

- name: Set up Java for publishing to CYBNITY Maven Repository
- name: Settings.xml definition for publishing to AGNet repository
uses: actions/setup-java@v4
with:
with: # running setup-java again overwrites the settings.xml
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: space-cybnity-open-source
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
server-id: agnet # Value of the distributionManagement/repository/id filed of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value (without an modification than exported by the gpg --export-secret-keys command) of the GPG private key (33105BFD367D25B3) to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: GitHub Environment Variables Action
if: ${{ env.ARTIFACT_VERSION == '' }}
uses: FranzDiebold/github-env-vars-action@v2.8.0
uses: FranzDiebold/github-env-vars-action@v2

- name: Define an unique revision name (pattern <<feature branch name>>.<<commit id abbrev>>.<<commit time>>)
if: ${{ env.ARTIFACT_VERSION == '' }}
run: |
echo "Git commit revision $CI_SHA_SHORT abbreviation based on 7 characters (default) maximum (origin based: $CI_SHA)"
echo "commit_id=$CI_SHA_SHORT" >> $GITHUB_ENV
echo "feature_name=$CI_ACTION_REF_NAME_SLUG" >> $GITHUB_ENV
- name: Identify the origin release name of the projects
if: ${{ env.ARTIFACT_VERSION == '' }}
# Define a static version name because not received from input parameter
Expand All @@ -80,8 +85,8 @@ jobs:
echo "Set the project artifacts version in pom.xml files"
echo "mvn -B -DgenerateBackupPoms=true -DprocessAllModules=true versions:set -DnewVersion=${{ env.current_artifacts_revision_id }}"
- name: Build and publish ${{ env.current_artifacts_revision_id }} version of java packages to remote repositories (Maven, Docker) via Maven (phases validate, compile, test, package, verify, install, deploy)
run: mvn --batch-mode --update-snapshots --show-version -Dstage=technical-quality -Drevision=${{ env.current_artifacts_revision_id }} -Ddocker.username=${{ env.DOCKER_REGISTRY_USERNAME }} -Ddocker.password=${{ env.DOCKER_REGISTRY_PASSWORD }} -Ddocker.cleanup=none --file pom.xml -DcreateChecksum=true deploy -Dmaven.test.skip=true
- name: Build and deploy ${{ env.current_artifacts_revision_id }} version of java packages to AGnet repository (Maven, Docker)
run: mvn --batch-mode --update-snapshots --show-version -Dstage=technical-quality -Drevision=${{ env.current_artifacts_revision_id }} -Ddocker.username=${{ env.DOCKER_REGISTRY_USERNAME }} -Ddocker.password=${{ env.DOCKER_REGISTRY_PASSWORD }} -Ddocker.cleanup=none --file pom.xml -DcreateChecksum=true -Denvironment=dev-deploy deploy -Dmaven.test.skip=true

# Optional: Uploads the full dependency graph to GitHub (output variable) to improve the quality of Dependabot alerts this repository can receive
#- name: Update dependency graph
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/software-project-aat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
# Build specific release name because none tag is existing on GitHub project
- name: Identify reusable environment variables about current commit
if: ${{ env.TAG_VERSION == '' }}
uses: FranzDiebold/github-env-vars-action@v2.8.0
uses: FranzDiebold/github-env-vars-action@v2

# Build name based on a potential included tag (e.g staging0.0.7-reviewed, staging-alpha, staging)
- name: Define a latest revision name regarding integrated development version
Expand Down
55 changes: 21 additions & 34 deletions implementation-line/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
<version>${revision}</version>
<relativePath>..</relativePath>
</parent>

<groupId>org.cybnity</groupId>
<artifactId>applications-impl</artifactId>
<artifactId>risk-mgt-applications-impl</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<name>CYBNITY RISK MANAGEMENT APPLICATION</name>

<properties>
<!-- CYBNITY project default revision -->
<revision>0.1.0</revision>
Expand Down Expand Up @@ -91,7 +93,7 @@

<profiles>
<profile>
<!-- Build regarding a development version on developer station -->
<!-- Developer workstation environment -->
<id>localhost</id>
<activation>
<activeByDefault>true</activeByDefault>
Expand All @@ -110,13 +112,11 @@
</profile>

<profile>
<!-- Build regarding a development version on shared development
platform -->
<!-- Shared development platform between developers -->
<id>dev-deploy-environment</id>
<activation>
<property>
<!-- Activation based on -D system property (e.g command
line with -Denvironment=dev-deploy) -->
<!-- Activation based on -D system property (e.g command line with -Denvironment=dev-deploy) -->
<name>environment</name>
<value>dev-deploy</value>
</property>
Expand All @@ -135,12 +135,11 @@
</profile>

<profile>
<!-- Build regarding a qualification version on test environment -->
<!-- Test environment -->
<id>qa-environment</id>
<activation>
<property>
<!-- Activation based on -D system property (e.g command
line with -Denvironment=qa) -->
<!-- Activation based on -D system property (e.g command line with -Denvironment=qa) -->
<name>environment</name>
<value>qa</value>
</property>
Expand Down Expand Up @@ -169,8 +168,7 @@
<id>commit-stage</id>
<activation>
<property>
<!-- Activation based on -D system property (e.g command
line with -Dstage=commit) -->
<!-- Activation based on -D system property (e.g command line with -Dstage=commit) -->
<name>stage</name>
<value>commit</value>
</property>
Expand Down Expand Up @@ -202,12 +200,11 @@
</profile>

<profile>
<!-- Build regarding a technical quality stage -->
<!-- Phase of technical quality validation of a software version -->
<id>technical-quality-stage</id>
<activation>
<property>
<!-- Activation based on -D system property (e.g command
line with -Dstage=technical-quality) -->
<!-- Activation based on -D system property (e.g command line with -Dstage=technical-quality) -->
<name>stage</name>
<value>technical-quality</value>
</property>
Expand Down Expand Up @@ -248,17 +245,15 @@
<goals>
<!-- Try to resolve all test scope -->
<goal>resolve</goal>
<!-- Try to resolve plugins and optionnaly
their dependencies -->
<!-- Try to resolve plugins and optionnaly their dependencies -->
<goal>resolve-plugins</goal>
</goals>
</execution>
<execution>
<id>analyze-dependencies</id>
<phase>validate</phase>
<goals>
<!-- Determine missing or unused
dependencies -->
<!-- Determine missing or unused dependencies -->
<goal>analyze-dep-mgt</goal>
<goal>analyze-duplicate</goal>
</goals>
Expand All @@ -267,15 +262,12 @@
<id>report-tree</id>
<phase>validate</phase>
<configuration>
<outputFile>
mpp-official-version-pom-tree.txt</outputFile>
<outputType>text</outputType>
<appendOutput>false</appendOutput>
<outputFile>mpp-official-version-pom-tree.txt</outputFile>
<outputType>text</outputType>
<appendOutput>false</appendOutput>
</configuration>
<goals>
<!-- Show the dependency hierarchy of the
project and dependencies versions managed by
the parent pom.xml -->
<!-- Show the dependency hierarchy of the project and dependencies versions managed by the parent pom.xml -->
<goal>tree</goal>
</goals>
</execution>
Expand All @@ -286,13 +278,11 @@
</profile>

<profile>
<!-- Phase of integration quality validation of a software version
(e.g on an test environment) -->
<!-- Phase of integration quality validation of a software version (e.g on an test environment) -->
<id>integration-quality-stage</id>
<activation>
<property>
<!-- Activation based on -D system property (e.g command
line with -Dstage=integration-quality) -->
<!-- Activation based on -D system property (e.g command line with -Dstage=integration-quality) -->
<name>stage</name>
<value>integration-quality</value>
</property>
Expand Down Expand Up @@ -325,18 +315,15 @@
</profile>

<profile>
<!-- Step of software behavior validation by testers community (e.g
regarding a software beta release) -->
<!-- Step of software behavior validation by testers community (e.g regarding a software beta release) -->
<id>user-acceptance-test-stage</id>
<activation>
<property>
<!-- Activation based on -D system property (e.g command
line with -Dstage=user-acceptance-test) -->
<!-- Activation based on -D system property (e.g command line with -Dstage=user-acceptance-test) -->
<name>stage</name>
<value>user-acceptance-test</value>
</property>
</activation>
</profile>

</profiles>
</project>
2 changes: 1 addition & 1 deletion implementation-line/risk-management/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>applications-impl</artifactId>
<artifactId>risk-mgt-applications-impl</artifactId>
<groupId>org.cybnity</groupId>
<version>${revision}</version>
<relativePath>..</relativePath>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 17d6d66

Please sign in to comment.