Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into mcobbett-1708-cps-controls-gherkin-terminal-…
Browse files Browse the repository at this point in the history
…size
  • Loading branch information
techcobweb committed Jul 26, 2024
2 parents 3ce45f5 + 3fb836c commit 67349a9
Show file tree
Hide file tree
Showing 48 changed files with 470 additions and 328 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Main build

on:
push:
branches: [main]

env:
REGISTRY: ghcr.io
NAMESPACE: galasa-dev
IMAGE_TAG: main

jobs:
build-managers:
name: Build Managers source code and Docker image for development Maven registry
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'semeru'

- name: Print githash
run: |
echo $GITHUB_SHA > ./managers.githash
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 6.9.2

- name: Build Managers source code
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEYID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
run: |
gradle -b galasa-managers-parent/build.gradle check publish \
-Dorg.gradle.jvmargs=-Xmx4096M \
-PsourceMaven=https://development.galasa.dev/gh/maven-repo/extensions \
-PcentralMaven=https://repo.maven.apache.org/maven2/ \
-PtargetMaven=${{github.workspace}}/repo \
-PjacocoEnabled=true \
-PisMainOrRelease=true
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Managers image
id: metadata
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/managers-maven-artefacts

- name: Build Managers image for development Maven registry
id: build
uses: docker/build-push-action@v5
with:
context: .
file: dockerfiles/dockerfile
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: |
dockerRepository=ghcr.io
tag=${{ env.IMAGE_TAG }}
- name: Recycle application in ArgoCD
env:
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }}
run: |
docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app actions run gh-maven-repos restart --kind Deployment --resource-name managers-gh --server argocd.galasa.dev
49 changes: 49 additions & 0 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: PR build

on:
pull_request:
branches: [main]

jobs:
build-managers:
name: Build Managers source code and Docker image
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'semeru'

- name: Print githash
run: |
echo $GITHUB_SHA > ./managers.githash
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 6.9.2

- name: Build Managers source code
run: |
gradle -b galasa-managers-parent/build.gradle check publish \
-Dorg.gradle.jvmargs=-Xmx4096M \
-PsourceMaven=https://development.galasa.dev/gh/maven-repo/extensions \
-PcentralMaven=https://repo.maven.apache.org/maven2/ \
-PtargetMaven=${{github.workspace}}/repo
- name: Build Managers image for testing
uses: docker/build-push-action@v5
with:
context: .
file: dockerfiles/dockerfile
load: true
tags: managers:test
build-args: |
dockerRepository=ghcr.io
tag=main
6 changes: 6 additions & 0 deletions dockerfiles/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG dockerRepository
ARG tag
FROM ${dockerRepository}/galasa-dev/extensions-maven-artefacts:${tag}

COPY repo/ /usr/local/apache2/htdocs/
COPY managers.githash /usr/local/apache2/htdocs/managers.githash
32 changes: 28 additions & 4 deletions galasa-managers-parent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@ subprojects {
plugins.withId('jacoco') {
rootProject.tasks.named('jacocoMerge').get().executionData(tasks.named('test').get())
}

// Uncomment the block below to get details about deprecations.

// tasks.withType(JavaCompile) {
// options.compilerArgs << '-Xlint:unchecked'
// options.deprecation = true
// }

// This task will suppress warnings (only in javadoc) about missing description for (@return, @throws etc..)
/*
Example warning:
warning: no description for @throws
* @throws SeleniumManagerException
*/
// However, it will not suppress warnings / errors in the code itself
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}

}

// Define the artifact
Expand Down Expand Up @@ -51,6 +71,10 @@ repositories {
}

signing {
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications
}

Expand All @@ -74,8 +98,8 @@ if (jacocoEnabled.toBoolean()) {

if ("$targetMaven".startsWith('http')) {
credentials {
username System.getenv('MAVENUSERNAME')
password System.getenv('MAVENPASSWORD')
username System.getenv("GITHUB_ACTOR")
password System.getenv("GITHUB_TOKEN")
}
}
}
Expand Down Expand Up @@ -230,8 +254,8 @@ publishing {

if ("$targetMaven".startsWith('http')) {
credentials {
username System.getenv('MAVENUSERNAME')
password System.getenv('MAVENPASSWORD')
username System.getenv("GITHUB_ACTOR")
password System.getenv("GITHUB_TOKEN")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ repositories {
}

signing {
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications
}

Expand Down Expand Up @@ -108,8 +112,8 @@ publishing {

if ("$targetMaven".startsWith('http')) {
credentials {
username System.getenv('MAVENUSERNAME')
password System.getenv('MAVENPASSWORD')
username System.getenv("GITHUB_ACTOR")
password System.getenv("GITHUB_TOKEN")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public interface ICeci {
* @param parseOutput parse the command output and store in {@link ICeciResponse}. Setting to false can improve performance on commands
* that contain a lot of output fields, e.g. <code>ASSIGN</code>.<br><br>
* The following examples shows how to retrieve a specific returned value:<br><code>
* issueCommand(ICicsTerminal, "ASSIGN USERID(&VAR)", false)<br>
* retrieveVariableText(ICicsTerminal, "ASSIGN USERID(&VAR)", false)
* issueCommand(ICicsTerminal, "ASSIGN USERID(&amp;VAR)", false)<br>
* retrieveVariableText(ICicsTerminal, "ASSIGN USERID(&amp;VAR)", false)
* </code>
* @return an {@link ICeciResponse} object containing the command's response.
* @throws CeciException
Expand Down Expand Up @@ -239,7 +239,7 @@ public interface ICeci {

/**
* Retrieve the content of the current EXEC Interface Block (EIB)
* @param terminal an {@link ICicsTerminal} object logged on to the CICS region and in an active CECI session.
* @param ceciTerminal an {@link ICicsTerminal} object logged on to the CICS region and in an active CECI session.
* @return the {@link IExecInterfaceBlock}
* @throws CeciException
*/
Expand All @@ -252,7 +252,7 @@ public interface ICeci {
* For example, the test could first issue <code>CEOT TRANIDONLY</code>
* @param programName the name of the PROGRAM
* @param commarea a string representing the COMMAREA. If null, COMMAREA will be omitted from the command. Can be CECI variable name populated with
* (<b>&</b>name set via {@link #defineVariableText(ICicsTerminal, String, String)}) or the actual data. The value of DATALENGTH in the command will be
* (<b>&amp;</b>)name set via {@link #defineVariableText(ICicsTerminal, String, String)}) or the actual data. The value of DATALENGTH in the command will be
* be allowed to default.
* @param sysid the system name where the CICS region where the link request is to be routed. If null, SYSID will be omitted from the command.
* @param transid the name of the mirror transaction on the remote region. If null, TRANSID will be omitted from the command.
Expand All @@ -263,8 +263,8 @@ public interface ICeci {
public ICeciResponse linkProgram(@NotNull ICicsTerminal ceciTerminal, @NotNull String programName, String commarea, String sysid, String transid, boolean synconreturn) throws CeciException;

/**
* EXEC CICS LINK to a PROGRAM with a CHANNEL. Use {@link #putContainer(ICicsTerminal, String, String, String)} to create the container(s) on the CHANNEL
* and {@link #getContainer(ICicsTerminal, String, String, String)} to retrieve the content after the LINK.
* EXEC CICS LINK to a PROGRAM with a CHANNEL. Use {@link #putContainer(ICicsTerminal, String, String, String, String, String, String)} to create the container(s) on the CHANNEL
* and {@link #getContainer(ICicsTerminal, String, String, String, String, String)} to retrieve the content after the LINK.
* @param ceciTerminal an {@link ICicsTerminal} object logged on to the CICS region and in an active CECI session.
* If mixed case is required, the terminal should be presented with no upper case translate status.
* For example, the test could first issue <code>CEOT TRANIDONLY</code>
Expand All @@ -279,7 +279,7 @@ public interface ICeci {
* @param ceciTerminal an {@link ICicsTerminal} object logged on to the CICS region and in an active CECI session.
* @param channelName the CHANNELNAME
* @param containerName the COTAINER name
* @param content a string representing the container contents. Can be CECI variable name populated with (<b>&</b>name set via {@link #defineVariableText(ICicsTerminal, String, String)})
* @param content a string representing the container contents. Can be CECI variable name populated with (<b>&amp;</b>)name set via {@link #defineVariableText(ICicsTerminal, String, String)})
* or the actual data. The value of FLENGTH in the command will be set to the data length.
* @param dataType BIT or CHAR. If null, DATATYPE will be omitted from the command.
* @param fromCcsid provides a value for FROMCCSID. If null, will be omitted from the command.
Expand All @@ -296,8 +296,7 @@ public interface ICeci {
* For example, the test could first issue <code>CEOT TRANIDONLY</code>
* @param channelName the CHANNELNAME
* @param containerName the CONTAINER name
* @param variableName the CECI variable name. Data can be retrieved using {@link #retrieveVariableText(ICicsTerminal, String)} or {@link #retrieveVariableHex(ICicsTerminal, String)}
* @param dataType BIT or CHAR. If null, DATATYPE will be omitted from the command.
* @param variableName the CECI variable name. Data can be retrieved using {@link #retrieveVariableText(ICicsTerminal, String)}
* @param intoCcsid provides a value for INTOCCSID. If null, will be omitted from the command.
* @param intoCodepage provides a value for INTOCODEPAGE. If null, will be omitted from the command.
* @return an {@link ICeciResponse} object containing the command's response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface ICemt {
/**
* Inquire a CEMT resource using the resource type and name.
* This does not support inquiries of multiple resources at once.
* Will return {@link null} if the resource is not found.
* @return null if the resource is not found.
* @param cemtTerminal an {@link ITerminal} object logged on to the CICS region and in an active CEMT session.
* If mixed case is required, the terminal should be presented with no upper case translate status.
* For example, the test could first issue <code>CEOT TRANIDONLY</code>
Expand Down
Loading

0 comments on commit 67349a9

Please sign in to comment.