Skip to content

Commit b4ac794

Browse files
Parameterize pipeline config
1 parent 28c23c2 commit b4ac794

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.gitlab-ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
variables:
2-
SONAR_TOKEN: ebe2ea223c26b8dda8eb79c3237cf8b7d3ecbd96 # SonarQube project token
3-
SONAR_HOST_URL: https://sonar.qc.on-target.tech # Base URL of SonarQube server
2+
SONAR_TOKEN: $SONAR_API_TOKEN # SonarQube project token
3+
SONAR_HOST_URL: $SONAR_URL # Base URL of SonarQube server
44
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
55
GIT_DEPTH: 0 # Tells git to fetch all the branches of the project, required by the sonar analysis task
6-
DAST_WEBSITE: https://cdw-build.apps.tanzu.on-target.tech # Website to be scanned in the DAST stage
6+
DAST_WEBSITE: $DAST_URL # Website to be scanned in the DAST stage
7+
BUILD_PATH: target/demo-0.0.1-SNAPSHOT.jar
78
KUBERNETES_CPU_REQUEST: 2
89
KUBERNETES_CPU_LIMIT: 6
910
KUBERNETES_MEMORY_REQUEST: 8Gi
@@ -30,7 +31,7 @@ build:
3031
script: ./mvnw clean package
3132
artifacts:
3233
paths:
33-
- target/demo-0.0.1-SNAPSHOT.jar
34+
- $BUILD_PATH
3435

3536
# Run code quality checks on the SonarQube server
3637
sonarqube-check:
@@ -39,7 +40,7 @@ sonarqube-check:
3940
name: sonarsource/sonar-scanner-cli:latest
4041
allow_failure: true
4142
script:
42-
- sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.projectKey=cdw-build -Dsonar.java.binaries=target/demo-0.0.1-SNAPSHOT.jar
43+
- sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.java.binaries=$BUILD_PATH
4344
only:
4445
- merge_requests
4546
- master
@@ -51,9 +52,9 @@ staging-deploy:
5152
name: openjdk:11-jdk
5253
script:
5354
- curl --location "https://packages.cloudfoundry.org/stable?release=linux64-binary&version=7.0.2&source=github-rel" | tar zx
54-
- ./cf api https://api.sys.tanzu.on-target.tech
55-
- ./cf auth [email protected] $CF_PASSWORD
56-
- ./cf target -o labs-canada -s tyler
55+
- ./cf api $CF_API
56+
- ./cf auth $CF_USER $CF_PASSWORD
57+
- ./cf target -o $CF_ORG -s $CF_SPACE
5758
- ./cf push -f manifest.yml
5859
only:
5960
- master

manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
applications:
33
- name: cdw-build
44
memory: 1G
5-
instances: 1
5+
instances: 3
66
random-route: false
77
path: target/demo-0.0.1-SNAPSHOT.jar
88
services: []

0 commit comments

Comments
 (0)