Skip to content

Commit

Permalink
Merge pull request #99 from gchq/develop
Browse files Browse the repository at this point in the history
Release 0.5.0
  • Loading branch information
ac74475 committed Jul 8, 2021
2 parents bc4aca3 + b68b1f9 commit 73d7ed4
Show file tree
Hide file tree
Showing 92 changed files with 1,055 additions and 6,498 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 Crown Copyright
# Copyright 2018-2021 Crown Copyright

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,6 +20,8 @@ node_modules/
.project
.settings
*.iml
*.DS_Store
.flattened-pom.xml
##VSCODE default files that dont need to be tracked
.vscode/

Expand Down
126 changes: 3 additions & 123 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Crown Copyright
* Copyright 2018-2021 Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,128 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//node-affinity
//nodes 1..3 are reserved for Jenkins slave pods.
//node 0 is used for the Jenkins master
@Library('jenkinsfile-lib')_

timestamps {

podTemplate(yaml: '''
apiVersion: v1
kind: Pod
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: palisade-node-name
operator: In
values:
- node1
- node2
- node3
containers:
- name: jnlp
image: jenkins/jnlp-slave
imagePullPolicy: Always
args:
- $(JENKINS_SECRET)
- $(JENKINS_NAME)
resources:
requests:
ephemeral-storage: "4Gi"
limits:
ephemeral-storage: "8Gi"
- name: docker-cmds
image: 779921734503.dkr.ecr.eu-west-1.amazonaws.com/jnlp-did:200608
imagePullPolicy: IfNotPresent
command:
- sleep
args:
- 99d
env:
- name: DOCKER_HOST
value: tcp://localhost:2375
resources:
requests:
ephemeral-storage: "4Gi"
limits:
ephemeral-storage: "8Gi"
''') {

node(POD_LABEL) {
def GIT_BRANCH_NAME

stage('Bootstrap') {
if (env.CHANGE_BRANCH) {
GIT_BRANCH_NAME = env.CHANGE_BRANCH
} else {
GIT_BRANCH_NAME = env.BRANCH_NAME
}
echo sh(script: 'env | sort', returnStdout: true)
}
stage('Install, Unit Tests, Checkstyle') {
dir('Palisade-common') {
git branch: GIT_BRANCH_NAME, url: 'https://github.com/gchq/Palisade-common.git'
container('docker-cmds') {
configFileProvider([configFile(fileId: "${env.CONFIG_FILE}", variable: 'MAVEN_SETTINGS')]) {
sh 'mvn -s $MAVEN_SETTINGS install'
}
}
}
}

stage('SonarQube analysis') {
dir('Palisade-common') {
container('docker-cmds') {
withCredentials([string(credentialsId: "${env.SQ_WEB_HOOK}", variable: 'SONARQUBE_WEBHOOK'),
string(credentialsId: "${env.SQ_KEY_STORE_PASS}", variable: 'KEYSTORE_PASS'),
file(credentialsId: "${env.SQ_KEY_STORE}", variable: 'KEYSTORE')]) {
configFileProvider([configFile(fileId: "${env.CONFIG_FILE}", variable: 'MAVEN_SETTINGS')]) {
withSonarQubeEnv(installationName: 'sonar') {
if (env.CHANGE_BRANCH) {
sh 'mvn -s $MAVEN_SETTINGS org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar -Dsonar.projectKey="Palisade-Common-${CHANGE_BRANCH}" -Dsonar.projectName="Palisade-Common-${CHANGE_BRANCH}" -Dsonar.webhooks.project=$SONARQUBE_WEBHOOK -Djavax.net.ssl.trustStore=$KEYSTORE -Djavax.net.ssl.trustStorePassword=$KEYSTORE_PASS'
} else {
sh 'mvn -s $MAVEN_SETTINGS org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar -Dsonar.projectKey="Palisade-Common-${BRANCH_NAME}" -Dsonar.projectName="Palisade-Common-${BRANCH_NAME}" -Dsonar.webhooks.project=$SONARQUBE_WEBHOOK -Djavax.net.ssl.trustStore=$KEYSTORE -Djavax.net.ssl.trustStorePassword=$KEYSTORE_PASS'
}
}
}
}
}
}

stage("SonarQube Quality Gate") {
// Wait for SonarQube to prepare the report
sleep(time: 10, unit: 'SECONDS')
// Just in case something goes wrong, pipeline will be killed after a timeout
timeout(time: 5, unit: 'MINUTES') {
// Reuse taskId previously collected by withSonarQubeEnv
def qg = waitForQualityGate()
if (qg.status != 'OK') {
error "Pipeline aborted due to SonarQube quality gate failure: ${qg.status}"
}
}
}
stage('Maven deploy') {
dir('Palisade-common') {
container('docker-cmds') {
configFileProvider([configFile(fileId: "${env.CONFIG_FILE}", variable: 'MAVEN_SETTINGS')]) {
if (("${env.BRANCH_NAME}" == "develop") ||
("${env.BRANCH_NAME}" == "master")) {
sh 'mvn -s $MAVEN_SETTINGS deploy -P default,quick,avro'
} else {
sh "echo - no deploy"
}
}
}
}
}
}
}
}

common()
}
16 changes: 1 addition & 15 deletions NOTICES.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
List of third-party dependencies grouped by their license type

### [Apache Software License 2.0](./licenses/apache_software_license_2.0.txt):
* Jackson-annotations ([com.fasterxml.jackson.core:jackson-annotations:2.10.0](http://github.com/FasterXML/jackson))
* Jackson-core ([com.fasterxml.jackson.core:jackson-core:2.10.0](https://github.com/FasterXML/jackson-core))
* jackson-databind ([com.fasterxml.jackson.core:jackson-databind:2.10.0](http://github.com/FasterXML/jackson))
* Jackson datatype: jdk8 ([com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.0](https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jdk8))
* Jackson datatype: JSR310 ([com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.0](https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310))
* Apache Commons IO ([commons-io:commons-io:2.6](http://commons.apache.org/proper/commons-io/))
* jackson-databind ([com.fasterxml.jackson.core:jackson-databind:2.11.0](http://github.com/FasterXML/jackson))
* Apache Avro ([org.apache.avro:avro:1.8.2](http://avro.apache.org))
* Apache Commons Lang ([org.apache.commons:commons-lang3:3.8.1](http://commons.apache.org/proper/commons-lang/))
* Commons Math ([org.apache.commons:commons-math3:3.1.1](http://commons.apache.org/math/))

### [Eclipse Public License 1.0](./licenses/eclipse_public_license_1.0.html):
* JUnit ([junit:junit:4.12](http://junit.org))

### [MIT License](./licenses/mit_license.html):
* mockito-core ([org.mockito:mockito-core:3.1.0](https://github.com/mockito/mockito))
* SLF4J API Module ([org.slf4j:slf4j-api:1.7.25](http://www.slf4j.org))
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!---
Copyright 2019 Crown Copyright
Copyright 2018-2021 Crown Copyright
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -14,21 +14,11 @@ 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.
--->


# <img src="logos/logo.svg" width="180">

### Scalable Data Access Policy Management and Enforcement

## Status
<span style="color:red">
This is not the main Palisade Repository, this is the Repository for Palisade Common. For more information, please visit Palisade
</span>

## Documentation

The documentation for the latest release can be found [here](https://gchq.github.io/Palisade).
## A Tool for Complex and Scalable Data Access Policy Enforcement

# Palisade Common

### Prerequisites
1. [Git](https://git-scm.com/)
Expand Down Expand Up @@ -134,14 +124,11 @@ cd Palisade-common
</p>
</details>



You are then ready to build with Maven:
```bash
mvn install
```


## License

Palisade-Common is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) and is covered by [Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/).
Expand All @@ -153,4 +140,5 @@ We welcome contributions to the project. Detailed information on our ways of wor

## FAQ

What versions of Java are supported? We are currently using Java 11.
Q: What versions of Java are supported?
A: We are currently using Java 11.
2 changes: 1 addition & 1 deletion code-style/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
~ Copyright 2020 Crown Copyright
~ Copyright 2018-2021 Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion code-style/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019 Crown Copyright
~ Copyright 2018-2021 Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 73d7ed4

Please sign in to comment.