Quickstart

ENVs

1
2
3
GH_USER=joostvdg
APP_NAME=jx-qs-spring-boot-1
GH_TOKEN=

Check Existing Applications

1
jx get applications

Create

1
jx create spring
1
jx create spring --git-username=${GH_USER} --git-api-token=${GH_TOKEN}

See Application in JX

Watch Activity

1
jx get activity -f jx-qs-spring-boot -w

Get Applications

1
jx get applications -e staging

Test Application

1
http https://jx-qs-spring-boot-7-jx-staging.staging.cjxd.kearos.net

Get Build Log

1
jx get build log

CJXD UI

1
jx ui -p 8082

Add Pipeline step

  • Open Application with Intelli J
  • open jenkins-x.yml

Build Packs

Add SonarCloud scan

Add env vars

1
2
3
4
5
6
7
8
9
pipelineConfig:
    env:
      - name: example
        value: someValue
      - name: fromSecret
        valueFrom:
          secretKeyRef:
            key: SONARCLOUD_APIKEY
            name: sonarcloud-apikey

Add step

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
pipelineConfig:
  pipelines:
    overrides:
      - name: mvn-deploy
        pipeline: release
        stage: build
        step:
          name: sonar
          command: sonar-scanner
          image: fabiopotame/sonar-scanner-cli # newtmitch/sonar-scanner for JDK 10+?
          dir: /workspace/source/
          args:
           - -Dsonar.projectName=jx-qs-spring-boot
           - -Dsonar.projectKey=jx-qs-spring-boot
           - -Dsonar.organization=joostvdg-github
           - -Dsonar.sources=./src/main/java/
           - -Dsonar.language=java
           - -Dsonar.java.binaries=./target/classes
           - -Dsonar.host.url=https://sonarcloud.io
           - -Dsonar.login=bebe633ad6599cbf52f7e0b9ee1bc2bbd3cd9c80
        type: after

Verify existing pipeline

1
jx step syntax effective

Make the Change

1
2
git add jenkins-x.yml
git commit -m "add sonarqube scan"
1
git push

Confirm build

1
jx get activity -f jx-qs-spring-boot-7 -w
1
jx get build logs