#StackBounty: #reactjs #continuous-integration #gitlab #licensing Automating the license checking in gitlab CI/CD pipeline

Bounty: 100

I am trying to implement the license checking of the installed packages in my react project on a GitLab CI/CD pipeline. Before the build stage, the pipeline should check all the available licenses and then whitelist or blacklist certain specified licenses.

I am using the license-checker package to implement a list of available licenses in a JSON file.
After executing the required command: license-checker --json > ./license.json, the output is:

license.json

{
  "@babel/plugin-transform-parameters@7.10.1": {
    "licenses": "MIT",
    "repository": "https://github.com/babel/babel",
    "path": "..../node_modules/@babel/plugin-transform-parameters",
    "licenseFile": "...../node_modules/@babel/plugin-transform-parameters/LICENSE"
  },
  "@babel/plugin-transform-property-literals@7.10.1": {
    "licenses": "MIT",
    "repository": "https://github.com/babel/babel",
    "path": "..../node_modules/@babel/plugin-transform-property-literals",
    "licenseFile": "...../node_modules/@babel/plugin-transform-property-literals/LICENSE"
  },
  "@babel/plugin-transform-react-constant-elements@7.10.1": {
    "licenses": "MIT",
    "repository": "https://github.com/babel/babel",
    "path": "..../node_modules/@babel/plugin-transform-react-constant-elements",
    "licenseFile": "...../node_modules/@babel/plugin-transform-react-constant-elements/LICENSE"
  }
  // .........and list goes on
}

.gitlab-ci.yml

include:
  - local: license-checker-config.yml

stages: 
  - dependency

dependency:
  image: node:12
  stage: dependency
  script: 
    - npm ci
    - echo "main file...."

license-checker-config.yml

before_script: 
  - ./license.json
  - echo "Checking licenses..."

License scanning should be initiated before the build process, so I included as a part of before_script.
In license-checker-config.yml, I need to include my JSON file and then check by iterating over it, if it contains license like MIT, then only the build stage should continue otherwise the build should fail.

With my current code setup, I executed the pipeline and got the error:

Executing "step_script" stage of the job script
00:01
$ ./license.json
/bin/bash: line 99: ./license.json: Permission denied
ERROR: Job failed: exit code 1

Even though the file license.json exists in the same root folder, it shows permission denied. Further, I am unable to figure out how to implement JSON file looping inside the yml file and then achieve the required.

Any help to get me through this is highly appreciated.


Get this bounty!!!

#StackBounty: #unity3d #continuous-integration #gitlab #gitlab-ci #gitlab-ci-runner Gitlab-CI: set different variables/paths depending …

Bounty: 100

I am using Gitlab CI to automate my unity builds. For this I use two machines. (one Mac and one windows machine. Important: build should only run on the first machine that is available. )

unity-build:
  script: "/Applications/Unity/Hub/Editor/2019.3.14f1/Unity.app/Contents/MacOS/Unity       
  -projectPath pathXY 
  -executeMethod BuildScript.PerformBuild
  -quit"
  stage: build
  tags:
    - unity-mac-runner, unity windows runner

The problematic line is this: script: "/Applications/Unity/Hub/Editor/2019.3.14f1/Unity.app/Contents/MacOS/Unity, because on my windows runner path to unity is "S:Unity2019.3.14f1EditorUnity.exe"

Tried to fix this with these changes:

windows job:
  stage: setpaths
  variables:
    UNITY_PATH: "S:/Unity/2019.3.14f1/Editor/Unity.exe"
  script: "set windows variables..."
  tags:
    - unity windows runner
#osx job:
#  stage: setpaths
#  variables:
#    UNITY_PATH: "S:/Unity/2019.3.14f1/Editor/Unity.exe"
#  script: "set mac variables..."
#  tags:
#    - unity-mac-runner

Questions

  1. How can I do this? What should I use?
  2. I tried to set path of unity installation depending on build runner, but I couldn’t get this to work.

An example would be nice. Thx a lot 😉


Get this bounty!!!

#StackBounty: #testing #continuous-integration #end-to-end #health-monitoring Continious E2E monitoring with SDK and service discovery …

Bounty: 300

we have a custom system and I was wondering if there are available analogs we can switch to.

Our system runs various language agnostic test suites against each node of given role. Each test process simply gets target node IP and some values and returns test results in specific format as output.

Questions are:

  • What is the proper term for such system?
  • Are there any known solutions like this?
  • Are there any best practices we can onboard while switching?

Simplified schema

Wanted features are:

  • Web frontend to configure, trigger executions and check results
  • Schedulled executions
  • Smart alert triggering
    (something like “more than 5 nodes failed the test” or “3 runs in a row had failed tests”)
  • Language agnostic tests
    (we have SDKs and and helper libraries using different languages, which we are also under test)
  • Custom service discovery support
    (basically we want to provide test configuration with role name and scheduller should fetch the list of nodes)

Thanks in advance!


Get this bounty!!!

#StackBounty: #docker #jenkins #docker-compose #continuous-integration #jacoco Containerised Applications (Docker) and Jenkins Slave CICD

Bounty: 50

I have created a jenkins slave with work directory. I then have a maven java application with a Dockerfile.

Dockerfile

#### BUILD image ###
FROM maven:3-jdk-11 as builder
RUN mkdir -p /build
WORKDIR /build
COPY pom.xml /build
RUN mvn -B dependency:resolve dependency:resolve-plugins
COPY /src /build/src
RUN mvn package

### RUN ###
FROM openjdk:11-slim as runtime
EXPOSE 8080
ENV APP_HOME /app
ENV JAVA_OPTS=""

RUN mkdir $APP_HOME
RUN mkdir $APP_HOME/config
RUN mkdir $APP_HOME/log

RUN mkdir $APP_HOME/src

VOLUME $APP_HOME/log
VOLUME $APP_HOME/config

WORKDIR $APP_HOME

COPY --from=builder /build/src  $APP_HOME/src
COPY --from=builder /build/target $APP_HOME/target
COPY --from=builder /build/target/*.jar app.jar

ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar app.jar" ]

Jenkins slave sees this Dockerfile and executes it. It builds the target folder. In the target folder, I have Jacoco to show code coverage.

Jenkins slave workspace is unable to see that target folder to show Code Coverage on the Jenkins jacoco page. How can i make this visible? I tried volumes in my docker-compose file as shown

docker-compose.yml

version: '3'
services:
  my-application-service:
    image: 'my-application-image:v1.0'
    build: .
    container_name: my-application-container
    ports:
      - 8090:8090
    volumes:
      - /home/bob/Desktop/project/jenkins/workspace/My-Application:/app

However, I am not able to get target folder in the workspace. How can i let jenkins slave see this jacoco code coverage?


Get this bounty!!!