Skip to content

Commit

Permalink
Merge pull request #67 from Ensono/fix/builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvenSpellmaker authored Aug 29, 2024
2 parents 4f781d5 + 0235301 commit 14438ba
Show file tree
Hide file tree
Showing 11 changed files with 387 additions and 438 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text eol=lf
*.cmd text eol=crlf
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: weekly
day: monday
timezone: Europe/London
open-pull-requests-limit: 10
rebase-strategy: disabled
Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
19 changes: 18 additions & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Amido
Copyright (c) 2024 Ensono

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Module Overview

This parent module provides shared functionality to the Stacks java modules. It's based on Spring
and contains the dependency management, shared properties, plugins, profiles, reporting and repositories.
It's intended to be the parent module for Amido Stacks but can also get used in your project.
This parent module provides shared functionality to the Stacks java modules. It's based on Spring
and contains the dependency management, shared properties, plugins, profiles, reporting and repositories.
It's intended to be the parent module for Ensono Stacks but can also get used in your project.

## Module Structure

Expand Down Expand Up @@ -46,6 +46,8 @@ In the `parent` section of your application's `pom.xml` add:
</dependency>
```

NOTE: You should check to see the latest version and use that.

Then you can do a `./mvnw clean compile` to fetch it; after that, you can use it like any other dependency.

```bash
Expand All @@ -58,7 +60,7 @@ Use it as you'd use any dependency in your build tool.

### Localized solution using Maven Archetypes

If you wish to customise the module and use your organisation's namespaces instead of Amido's, you can create a
If you wish to customise the module and use your organisation's namespaces instead of Ensono's, you can create a
[Maven archetype](https://maven.apache.org/archetype/index.html). Archetypes are Maven's tool for
scaffolding and offers lots of extra functionality. We suggest spending some time looking into them.
We use Archetype to create a template and enable you to adopt this module under your organisation's namespace.
Expand Down Expand Up @@ -95,7 +97,7 @@ To use the deployed archetypes:
>
>- Update them manually
>- Re-create the relevant `import` statements to use the new-made module instead
>- If you plan to use this with Amido Stacks, include your namespace in the `@ComponentScan` annotation of the `Application` class.
>- If you plan to use this with Ensono Stacks, include your namespace in the `@ComponentScan` annotation of the `Application` class.
### Building the module locally from this repository
Expand All @@ -107,7 +109,7 @@ To build the module locally:
### Creating an Archetype from this repository
If you wish to customise the module and use your organisation's namespaces instead of Amido's. You can create a
If you wish to customise the module and use your organisation's namespaces instead of Ensono's. You can create a
[Maven archetype](https://maven.apache.org/archetype/index.html). Archetype is Maven's tool for
scaffolding and offers lots of extra functionality. We suggest spending some time looking into them. We use Archetype to create a template and enable you to adopt this module under your organisation's namespace.
To use the deployed archetypes:
Expand Down Expand Up @@ -163,4 +165,4 @@ To build, install and use the archetype follow these steps:
>
>- Update them manually
>- Re-create the relevant `import` statements to use the new-made module instead
>- If you plan to use this with Amido Stacks, include your namespace in the `@ComponentScan` annotation of the `Application` class.
>- If you plan to use this with Ensono Stacks, include your namespace in the `@ComponentScan` annotation of the `Application` class.
33 changes: 15 additions & 18 deletions build/azDevOps/azure/azure-pipelines-javaspring-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,16 @@ resources:
# REPOSITORY IS PUBLIC
endpoint: ensonostacks

# NOTE: To use the branch release containers, prefix with ensonostackseuweirdfmu.azurecr.io/
# i.e. ensonostackseuweirdfmu.azurecr.io/ensono/eir-java:1.1.222
containers:
# Container for Java Build and Testing
- container: azul_java
image: amidostacks/runner-pwsh-java:0.3.94-main
# Container for inlining Jacoco assets as Azure DevOps strips them
# https://github.com/microsoft/azure-pipelines-tasks/issues/3027
- container: node
image: amidostacks/node-14:0.0.1
# Container for Sonar Scanner
- container: sonar_scanner
image: amidostacks/ci-sonarscanner:0.0.2
- container: azul_java
image: ensono/eir-java:1.1.222
# Container for Kubernetes Deployment
- container: k8s_deploy
image: amidostacks/ci-k8s:0.0.12
image: ensono/eir-infrastructure:1.1.222

variables:
- template: azuredevops-vars.yml
Expand All @@ -53,13 +49,16 @@ stages:
variables:
# You can find notes in the READMEs around which values to use for each ENV variable group
- group: stacks-credentials-nonprod-kv
- group: sonar-credentials
- group: stacks-java-modules
- group: stacks-java-module-parent
jobs:
- job: ModuleBuild
pool:
vmImage: $(pool_vm_image)
steps:
- checkout: self
fetchDepth: 0

- checkout: templates

Expand Down Expand Up @@ -91,14 +90,15 @@ stages:
# Vulnerability Scanning
vulnerability_scan: "${{ variables.vulnerability_scan }}"
vulnerability_scan_fail_build_on_detection: "${{ variables.vulnerability_scan_fail_build_on_detection }}"
vulnerability_scan_api_key: ${{ variables.vulnerability_scan_api_key }}
vulnerability_scan_database_directory: ${{ variables.vulnerability_scan_database_directory }}
project_type: "${{ variables.java_project_type }}"
build_type: "${{ variables.build_type }}"
# private key id to sign doc
gpg_key_signing_id: "$(gpg-key-signing-id)"
gpg_private_key: "$(gpg-private-key)"
vulnerability_scan_report: "${{ variables.vulnerability_scan_report }}"


# Performs static code analysis, such as Sonar Cloud
- template: azDevOps/azure/templates/steps/java/test-static-code-analysis.yml@templates
parameters:
Expand All @@ -109,17 +109,16 @@ stages:
target_branch_ref: "$(target_branch_ref)"
pullrequest_number: "$(pullrequest_number)"
# Sonar
sonar_enable: ${{ variables.sonar_enable }}
sonar_container: "${{ variables.sonar_container }}"
sonar_host_url: "${{ variables.sonar_host_url }}"
sonar_enable: true
sonar_container: "azul_java"
sonar_host_url: "https://sonarcloud.io"
sonar_project_name: "$(SONAR_PROJECT_NAME)"
sonar_project_key: "$(SONAR_PROJECT_KEY)"
sonar_token: "$(SONAR_TOKEN)"
sonar_organisation: "$(SONAR_ORGANIZATION)"
sonar_organisation: "$(SONAR_ORGANISATION)"
# Probably `GitHub` or `vsts`
sonar_pullrequest_provider: "GitHub"
sonar_remote_repo: "${{ variables.self_remote_repo }}"
sonar_command: "${{ variables.sonar_command }}"
# Docker
docker_image_tag: "${{ variables.docker_image_tag }}"

Expand All @@ -139,6 +138,7 @@ stages:
functional_test_artefact_path: "${{ variables.functional_test_artefact_path }}"
vulnerability_scan: "${{ variables.vulnerability_scan }}"
vulnerability_scan_report: "${{ variables.vulnerability_scan_report }}"
vulnerability_scan_database_directory: "${{ variables.vulnerability_scan_database_directory }}"
java_project_type: "${{ variables.java_project_type }}"
functional_test_project_type: "${{ variables.functional_test_project_type }}"
# Docker
Expand Down Expand Up @@ -181,9 +181,6 @@ stages:
ossrh_jira_password: "$(ossrh-jira-password)"
# Docker
docker_build_container: "${{ variables.docker_java_image }}"
# Vulnerability Scanning
vulnerability_scan: "${{ variables.vulnerability_scan }}"
vulnerability_scan_fail_build_on_detection: "${{ variables.vulnerability_scan_fail_build_on_detection }}"
project_type: "${{ variables.java_project_type }}"
build_type: "${{ variables.build_type }}"
# private key id to sign doc
Expand Down
10 changes: 7 additions & 3 deletions build/azDevOps/azure/azuredevops-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ variables:
- name: region
value: westeurope
- name: company
value: amido
value: Ensono
- name: project
value: stacks
- name: domain
Expand All @@ -23,7 +23,7 @@ variables:
# It is case sensitive for TFS based repos

- name: self_remote_repo
value: "amido/$(self_repo)"
value: "Ensono/$(self_repo)"
- name: self_post_deploy_test_src
value: "api-tests"
- name: self_repo_dir
Expand Down Expand Up @@ -84,7 +84,7 @@ variables:

# DEFAULT IMAGE RUNNER
- name: pool_vm_image
value: ubuntu-22.04
value: ubuntu-24.04

# Maven
- name: maven_package_version
Expand Down Expand Up @@ -117,6 +117,10 @@ variables:
value: "target/dependency-check-report.html"
- name: vulnerability_scan_fail_build_on_detection
value: false
- name: vulnerability_scan_api_key
value: "$(VULNERABILITY_SCAN_API_KEY)"
- name: vulnerability_scan_database_directory
value: ${{ variables.self_repo_dir }}/.vulnerability-database

# Yamllint
- name: yamllint_config_file
Expand Down
Loading

0 comments on commit 14438ba

Please sign in to comment.