-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
130 changed files
with
2,726 additions
and
1,432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# This workflow checks out code, builds an image, performs a container image | ||
# vulnerability scan with Anchore's Grype tool, and integrates the results with GitHub Advanced Security | ||
# code scanning feature. For more information on the Anchore scan action usage | ||
# and parameters, see https://github.com/anchore/scan-action. For more | ||
# information on Anchore's container image scanning tool Grype, see | ||
# https://github.com/anchore/grype | ||
name: Anchore Container Scan | ||
|
||
on: | ||
push: | ||
branches: [ develop] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Anchore-Build-Scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v2 | ||
- name: Build the Docker image | ||
run: docker pull lfeoperatorfabric/of-cards-consultation-business-service:3.2.0.RELEASE | ||
- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled | ||
uses: anchore/scan-action@v3 | ||
with: | ||
image: "lfeoperatorfabric/of-cards-consultation-business-service:3.2.0.RELEASE" | ||
acs-report-enable: true | ||
fail-build: false | ||
- name: Upload Anchore Scan Report | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: results.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.inputs.dockerPush != 'true' && github.event.inputs.dockerPushLatest != 'true' && github.event.inputs.doc != 'true' && github.event.inputs.docLatest != 'true' && github.event_name != 'schedule' && github.ref_name != 'master' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
|
@@ -94,7 +95,6 @@ jobs: | |
if: ${{ github.event.inputs.build == 'true' || github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event_name == 'push'}} | ||
run: | | ||
export OF_VERSION=$(<VERSION) | ||
echo ${{ secrets.DOCKER_TOKEN }} | docker login --username opfabtravis --password-stdin | ||
docker-compose -f src/main/docker/test-environment/docker-compose.yml up -d | ||
./gradlew --build-cache copyDependencies test jacocoTestReport sonarqube dockerTag${OF_VERSION} | ||
docker-compose -f src/main/docker/test-environment/docker-compose.yml down | ||
|
@@ -128,6 +128,90 @@ jobs: | |
cd config/docker | ||
docker-compose down | ||
publish: | ||
runs-on: ubuntu-latest | ||
environment: publishVersion | ||
if: ${{ github.event.inputs.dockerPush == 'true' || github.event.inputs.dockerPushLatest == 'true' || github.event.inputs.doc == 'true' || github.event.inputs.docLatest == 'true' || github.event_name == 'schedule' || github.ref_name == 'master' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Job status | ||
run: | | ||
export OF_VERSION=$(<VERSION) | ||
echo "----------------------------" | ||
echo "Trigger by : ${{ github.event_name }}" | ||
echo "On branch : ${{ github.ref_name }} " | ||
echo "PR source branch : ${{ github.head_ref }} " | ||
echo "PR target branch : ${{ github.base_ref }} " | ||
echo "Opfab Version : ${OF_VERSION}" | ||
echo "---------------------------" | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle.properties','**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
|
||
# Install all required tools | ||
- name: Install | ||
run: | | ||
curl -s "https://get.sdkman.io" | bash ; | ||
echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config ; | ||
echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config ; | ||
source $HOME/.sdkman/bin/sdkman-init.sh; | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
source ./bin/load_environment_light.sh; | ||
sudo apt-get install jq | ||
echo "npm version $(npm -version)" | ||
echo "node version $(node --version)" | ||
sdk version | ||
javac -version | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "OpfabTech" | ||
- name: Build | ||
if: ${{ github.event.inputs.build == 'true' || github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event_name == 'push'}} | ||
run: | | ||
export OF_VERSION=$(<VERSION) | ||
echo ${{ secrets.DOCKER_TOKEN }} | docker login --username opfabtravis --password-stdin | ||
docker-compose -f src/main/docker/test-environment/docker-compose.yml up -d | ||
./gradlew --build-cache copyDependencies test jacocoTestReport sonarqube dockerTag${OF_VERSION} | ||
docker-compose -f src/main/docker/test-environment/docker-compose.yml down | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/ | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
- name: Karate tests | ||
if: ${{ github.event.inputs.karate == 'true' || github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event_name == 'push' }} | ||
run: | | ||
cd config/docker | ||
./docker-compose.sh | ||
cd ../../bin | ||
./waitForOpfabToStart.sh | ||
cd ../src/test/api/karate | ||
./launchAll.sh | ||
cd ../../../../config/docker | ||
docker-compose down --remove-orphans | ||
- name: Cypress tests | ||
if: ${{ github.event.inputs.cypress == 'true' || github.event_name == 'schedule' || github.event_name == 'pull_request' || github.event_name == 'push' }} | ||
run: | | ||
cd config/docker | ||
./docker-compose-cypress.sh | ||
cd ../../bin | ||
./waitForOpfabToStart.sh | ||
cd ../ | ||
./gradlew runCypressTests | ||
cd config/docker | ||
docker-compose down | ||
- name : Publish Documentation | ||
if : ${{ github.event.inputs.doc == 'true' || github.event_name == 'schedule'}} | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.2.0.RELEASE | ||
3.3.0.RELEASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
server: | ||
port: 2105 | ||
spring: | ||
application: | ||
name: external-devices | ||
operatorfabric: | ||
externaldevices: | ||
watchdog: | ||
enabled: true | ||
default: | ||
deviceConfigurations: | ||
- id: CDS_1 | ||
host: localhost | ||
port: 4030 | ||
signalMappingId: default_CDS_mapping | ||
- id: CDS_2 | ||
host: localhost | ||
port: 4030 | ||
signalMappingId: broken_CDS_mapping | ||
signalMappings: | ||
- id: default_CDS_mapping | ||
supportedSignals: | ||
ALARM: 1 | ||
ACTION: 2 | ||
COMPLIANT: 3 | ||
INFORMATION: 4 | ||
- id: broken_CDS_mapping | ||
supportedSignals: | ||
ALARM: 5 | ||
ACTION: 6 | ||
COMPLIANT: 7 | ||
INFORMATION: 8 | ||
userConfigurations: | ||
- userLogin: operator1 | ||
externalDeviceId: CDS_1 | ||
- userLogin: operator2 | ||
externalDeviceId: CDS_2 | ||
- userLogin: operator3 | ||
externalDeviceId: CDS_3 | ||
logging.level.org.opfab: debug | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker-compose down -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker-compose down -v |
Oops, something went wrong.