Skip to content

Commit

Permalink
Merge branch 'main' into add-sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
Meer Sawood authored Nov 29, 2023
2 parents 065ac80 + 26b3168 commit 0e21b0f
Show file tree
Hide file tree
Showing 38 changed files with 409 additions and 229 deletions.
3 changes: 1 addition & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
comment: off
coverage:
status:
project:
default:
target: auto
threshold: 1%
removed_code_behavior: adjust_base
patch:
patch:
default:
informational: true
target: auto
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/build.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/codecov-main.yaml

This file was deleted.

19 changes: 12 additions & 7 deletions .github/workflows/go-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Validate PR - golang CI
name: GoLang CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
Expand All @@ -18,13 +21,14 @@ jobs:
go:
name: Check sources
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- name: Check out code
uses: actions/checkout@v4
go-version-file: './go.mod'
- name: Check go mod status
run: |
go mod tidy
Expand Down Expand Up @@ -56,12 +60,12 @@ jobs:
name: Golang Unit tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- name: Check out code
uses: actions/checkout@v4
go-version-file: './go.mod'
- name: Build
run: make build
- name: Test
Expand All @@ -71,6 +75,7 @@ jobs:
security_scan:
name: Security scan
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/java-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Java CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Build with Maven
working-directory: java-components
run: mvn -V -B package -Dvalidate-format
- name: Codecov
uses: codecov/codecov-action@v3
3 changes: 1 addition & 2 deletions .github/workflows/kube-linter.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check Kubernetes YAMLs with kube-linter
name: Validate Kubernetes YAMLs

on:
pull_request:
Expand All @@ -7,7 +7,6 @@ on:
- 'deploy/crds/base/**.ya?ml'
- 'deploy/operator/base/**.ya?ml'
- 'deploy/operator/config/**.ya?ml'

jobs:
kube-linter:
name: Kube linter
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/minikube.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate PR - Minikube Tests
name: Minikube Tests
on:
pull_request:
branches: [ main ]
Expand Down
5 changes: 0 additions & 5 deletions deploy/base-development.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ DIR=`dirname $0`
kubectl apply -f $DIR/namespace.yaml
kubectl config set-context --current --namespace=test-jvm-namespace

if [ -n "$QUAY_ORG" ] && [ -n "$QUAY_TOKEN" ]; then
kubectl delete --ignore-not-found secret -n image-controller quaytoken
kubectl create secret generic -n image-controller quaytoken --from-literal "quaytoken=$QUAY_TOKEN" --from-literal "organization=$QUAY_ORG"
fi

echo -e "\033[0;32mSecrets...\033[0m"
kubectl create --dry-run=client -o=yaml secret generic jvm-build-image-secrets --from-file=.dockerconfigjson=$HOME/.docker/config.json --type=kubernetes.io/dockerconfigjson | kubectl apply -f -
kubectl create --dry-run=client -o=yaml secret generic jvm-build-git-secrets --from-literal .git-credentials="
Expand Down
18 changes: 18 additions & 0 deletions deploy/crds/base/jvmbuildservice.io_dependencybuilds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ spec:
items:
type: string
type: array
gitArchive:
description: The git archive source information
properties:
sha:
type: string
tag:
type: string
url:
type: string
type: object
hermeticBuildImage:
description: The hermetic build image produced by the
build
Expand Down Expand Up @@ -262,12 +272,20 @@ spec:
contaminates:
items:
properties:
allowed:
type: boolean
buildId:
type: string
contaminatedArtifacts:
items:
type: string
type: array
gav:
type: string
rebuildAvailable:
type: boolean
source:
type: string
type: object
type: array
deployedArtifacts:
Expand Down
2 changes: 2 additions & 0 deletions deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ spec:
type: boolean
gitSourceArchive:
properties:
disableSSLVerification:
type: boolean
identity:
type: string
url:
Expand Down
9 changes: 0 additions & 9 deletions deploy/operator/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ spec:
labels:
app: hacbs-jvm-operator
spec:
volumes:
- name: quaytoken
secret:
optional: false
secretName: quaytoken
securityContext:
runAsNonRoot: true
containers:
Expand All @@ -37,10 +32,6 @@ spec:
limits:
memory: "1024Mi"
cpu: "500m"
volumeMounts:
- mountPath: "/workspace"
name: quaytoken
readOnly: true
securityContext:
readOnlyRootFilesystem: true
serviceAccountName: hacbs-jvm-operator
8 changes: 0 additions & 8 deletions deploy/operator/overlays/ci-template/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,3 @@ resources:
# and I'm bypassing that gross env var munging we had to do in infra-deps; also, the deployment yaml should be pretty static at this point
- base-deployment.yaml

patches:
- patch: |-
- op: replace
path: /spec/template/spec/volumes/0/secret/optional
value: true
target:
kind: Deployment
name: hacbs-jvm-operator
7 changes: 0 additions & 7 deletions deploy/operator/overlays/dev-template/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,4 @@ patches:
target:
kind: Deployment
name: hacbs-jvm-operator
- patch: |-
- op: replace
path: /spec/template/spec/volumes/0/secret/optional
value: true
target:
kind: Deployment
name: hacbs-jvm-operator
- path: namespace.yaml
1 change: 1 addition & 0 deletions deploy/overlays/dev-template/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
gitSourceArchive:
identity: GIT_DEPLOY_IDENTITY
url: GIT_DEPLOY_URL
disableSSLVerification: GIT_DISABLE_SSL_VERIFICATION
relocationPatterns:
- relocationPattern:
buildPolicy: "default"
Expand Down
6 changes: 5 additions & 1 deletion deploy/patch-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ fi
if [ -z "${GIT_DEPLOY_IDENTITY}" ]; then
GIT_DEPLOY_IDENTITY=""
fi
find $DIR -path \*development\*.yaml -exec $SED -i s/GIT_DEPLOY_URL/${GIT_DEPLOY_URL}/ {} \;
if [ -z "${GIT_DISABLE_SSL_VERIFICATION}" ]; then
GIT_DISABLE_SSL_VERIFICATION="false"
fi
find $DIR -path \*development\*.yaml -exec $SED -i s%GIT_DEPLOY_URL%${GIT_DEPLOY_URL}% {} \;
find $DIR -path \*development\*.yaml -exec $SED -i s%GIT_DEPLOY_IDENTITY%${GIT_DEPLOY_IDENTITY}% {} \;
find $DIR -path \*development\*.yaml -exec $SED -i s%GIT_DISABLE_SSL_VERIFICATION%${GIT_DISABLE_SSL_VERIFICATION}% {} \;
Loading

0 comments on commit 0e21b0f

Please sign in to comment.