Skip to content

Commit

Permalink
Merge branch 'new-name' of github.com:intelops/qualitytrace into new-…
Browse files Browse the repository at this point in the history
…name
  • Loading branch information
RazenaSaleem committed May 16, 2024
2 parents e476be5 + 7d8e280 commit 88727ac
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 56 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/cli_release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and publish quality-trace CLI
name: Build and publish qualitytrace CLI
on:
push:
tags:
Expand All @@ -14,16 +14,16 @@ jobs:
- name: Set up Go environment
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: Build my CLI for Linux
run: go mod download && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o quality-trace-linux cli/main.go
run: go mod download && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o qualitytrace-linux cli/main.go

- name: Build my CLI for macOS
run: go mod download && GOOS=darwin GOARCH=amd64 go build -o quality-trace-macos cli/main.go
run: go mod download && GOOS=darwin GOARCH=amd64 go build -o qualitytrace-macos cli/main.go

- name: Build my CLI for Windows
run: go mod download && GOOS=windows GOARCH=amd64 go build -o quality-trace-windows.exe cli/main.go
run: go mod download && GOOS=windows GOARCH=amd64 go build -o qualitytrace-windows.exe cli/main.go

- name: Get release name from tag
id: release
Expand All @@ -35,9 +35,9 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
quality-trace-linux
quality-trace-macos
quality-trace-windows.exe
qualitytrace-linux
qualitytrace-macos
qualitytrace-windows.exe
tag_name: ${{ github.ref }}
name: ${{ steps.release.outputs.name }} - Linux
draft: false
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/helm_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Add Helm repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Run chart-releaser
uses: helm/[email protected]
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Quality-Trace-Cli Docker Image CI - PR
name: qualitytrace-cli Docker Image CI - PR

on:
pull_request:
Expand All @@ -11,6 +11,8 @@ jobs:
env:
REGISTRY: ghcr.io
GH_URL: https://github.com
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
steps:
-
name: Checkout
Expand All @@ -29,11 +31,11 @@ jobs:
name: Set up Go environment
uses: actions/setup-go@v4
with:
go-version: '1.21.1'
go-version: '1.21'

-
name: Build cli
run: make dist/quality-trace
run: make dist/qualitytrace
env:
GO111MODULE: on

Expand All @@ -42,8 +44,8 @@ jobs:
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ env.registry_username }}
password: ${{ env.registry_password }}


-
Expand All @@ -56,5 +58,5 @@ jobs:
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}/cli:pr-${{ github.event.pull_request.number }}
build-args: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
"GITHUB_TOKEN=${{ env.registry_password }}"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: quality-trace-cli docker release
name: qualitytrace-cli docker release
on:
push:
tags:
Expand All @@ -16,6 +16,8 @@ jobs:
env:
REGISTRY: ghcr.io
GH_URL: https://github.com
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Set environment variable
run: |
Expand All @@ -28,16 +30,16 @@ jobs:
uses: actions/checkout@v3

- name: Build cli
run: make dist/quality-trace
run: make dist/qualitytrace
env:
GO111MODULE: on

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ env.registry_username }}
password: ${{ env.registry_password }}

- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v4
Expand All @@ -56,7 +58,7 @@ jobs:
COSIGN_EXPERIMENTAL: 1

- name: Verify the pushed tags
run: cosign verify ${{ env.REGISTRY }}/${{ github.repository }}/cli:${{ env.RELEASE_VERSION }} --certificate-identity ${{ env.GH_URL }}/${{ github.repository }}/.github/workflows/quality-trace-cli-release.yaml@refs/tags/${{ env.RELEASE_VERSION }} --certificate-oidc-issuer https://token.actions.githubusercontent.com
run: cosign verify ${{ env.REGISTRY }}/${{ github.repository }}/cli:${{ env.RELEASE_VERSION }} --certificate-identity ${{ env.GH_URL }}/${{ github.repository }}/.github/workflows/qualitytrace-cli-release.yaml@refs/tags/${{ env.RELEASE_VERSION }} --certificate-oidc-issuer https://token.actions.githubusercontent.com
env:
COSIGN_EXPERIMENTAL: 1

Expand All @@ -67,4 +69,4 @@ jobs:
format: 'github'
output: 'dependency-results.sbom.json'
image-ref: '.'
github-pat: ${{ secrets.GITHUB_TOKEN }} # or ${{ secrets.github_pat_name }} if you're using a PAT
github-pat: ${{ env.registry_password }} # or ${{ secrets.github_pat_name }} if you're using a PAT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Quality-Trace Cli Docker Image
name: qualitytrace Cli Docker Image

on:
push:
Expand All @@ -22,6 +22,8 @@ jobs:
env:
REGISTRY: ghcr.io
GH_URL: https://github.com
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout GitHub Action
uses: actions/checkout@v3
Expand All @@ -33,10 +35,10 @@ jobs:
- name: Set up Go environment
uses: actions/setup-go@v4
with:
go-version: '1.21.1'
go-version: '1.21'

- name: Build cli
run: make dist/quality-trace
run: make dist/qualitytrace
env:
GO111MODULE: on

Expand All @@ -57,8 +59,8 @@ jobs:
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ env.registry_username }}
password: ${{ env.registry_password }}

- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v4
Expand All @@ -82,7 +84,7 @@ jobs:
COSIGN_EXPERIMENTAL: 1

- name: Verify the pushed tags
run: cosign verify ${{ env.REGISTRY }}/${{ github.repository }}/cli:${{ github.run_id }} --certificate-identity ${{ env.GH_URL }}/${{ github.repository }}/.github/workflows/quality-trace-cli.yaml@refs/heads/main --certificate-oidc-issuer https://token.actions.githubusercontent.com
run: cosign verify ${{ env.REGISTRY }}/${{ github.repository }}/cli:${{ github.run_id }} --certificate-identity ${{ env.GH_URL }}/${{ github.repository }}/.github/workflows/qualitytrace-cli.yaml@refs/heads/main --certificate-oidc-issuer https://token.actions.githubusercontent.com
env:
COSIGN_EXPERIMENTAL: 1

Expand All @@ -93,4 +95,4 @@ jobs:
format: 'github'
output: 'dependency-results.sbom.json'
image-ref: '.'
github-pat: ${{ secrets.GITHUB_TOKEN }}
github-pat: ${{ env.registry_password }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Quality-Trace Docker Image CI - PR
name: qualitytrace-server Docker Image CI - PR

on:
pull_request:
Expand All @@ -11,6 +11,8 @@ jobs:
env:
REGISTRY: ghcr.io
GH_URL: https://github.com
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
steps:
-
name: Checkout
Expand All @@ -29,11 +31,11 @@ jobs:
name: Set up Go environment
uses: actions/setup-go@v4
with:
go-version: '1.21.1'
go-version: '1.21'

-
name: Build server
run: make dist/quality-trace-server
run: make dist/qualitytrace-server
env:
GO111MODULE: on

Expand All @@ -42,9 +44,8 @@ jobs:
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

username: ${{ env.registry_username }}
password: ${{ env.registry_password }}

-
name: Build and push on PR
Expand All @@ -56,5 +57,5 @@ jobs:
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}:pr-${{ github.event.pull_request.number }}
build-args: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
"GITHUB_TOKEN=${{ env.registry_password }}"
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: quality-trace-release
name: qualitytrace-server release
on:
push:
tags:
- "v*.*.*"
jobs:
push_to_registry:
name: Build and push Docker image github container registry.
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
packages: write
id-token: write
Expand All @@ -16,6 +16,8 @@ jobs:
env:
REGISTRY: ghcr.io
GH_URL: https://github.com
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Set environment variable
run: |
Expand All @@ -25,15 +27,15 @@ jobs:
- name: Check out GitHub repo
uses: actions/checkout@v3
- name: Build server
run: make dist/quality-trace-server
run: make dist/qualitytrace-server
env:
GO111MODULE: on
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ env.registry_username }}
password: ${{ env.registry_password }}
- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v4
with:
Expand All @@ -49,7 +51,7 @@ jobs:
env:
COSIGN_EXPERIMENTAL: 1
- name: Verify the pushed tags
run: cosign verify ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.RELEASE_VERSION }} --certificate-identity ${{ env.GH_URL }}/${{ github.repository }}/.github/workflows/quality-trace-container-release.yml@refs/tags/${{ env.RELEASE_VERSION }} --certificate-oidc-issuer https://token.actions.githubusercontent.com
run: cosign verify ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.RELEASE_VERSION }} --certificate-identity ${{ env.GH_URL }}/${{ github.repository }}/.github/workflows/qualitytrace-container-release.yml@refs/tags/${{ env.RELEASE_VERSION }} --certificate-oidc-issuer https://token.actions.githubusercontent.com
env:
COSIGN_EXPERIMENTAL: 1
- name: Run Trivy in GitHub SBOM mode and submit results to Dependency Graph
Expand All @@ -59,4 +61,4 @@ jobs:
format: 'github'
output: 'dependency-results.sbom.json'
image-ref: '.'
github-pat: ${{ secrets.GITHUB_TOKEN }} # or ${{ secrets.github_pat_name }} if you're using a PAT
github-pat: ${{ env.registry_password }} # or ${{ secrets.github_pat_name }} if you're using a PAT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Quality-Trace Docker Image CI
name: qualitytrace-server Docker Image CI

on:
push:
Expand All @@ -22,6 +22,8 @@ jobs:
env:
REGISTRY: ghcr.io
GH_URL: https://github.com
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout GitHub Action
uses: actions/checkout@v3
Expand All @@ -33,10 +35,10 @@ jobs:
- name: Set up Go environment
uses: actions/setup-go@v4
with:
go-version: '1.21.1'
go-version: '1.21'

- name: Build server
run: make dist/quality-trace-server
run: make dist/qualitytrace-server
env:
GO111MODULE: on

Expand All @@ -57,8 +59,8 @@ jobs:
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ env.registry_username }}
password: ${{ env.registry_password }}

- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v4
Expand All @@ -82,7 +84,7 @@ jobs:
COSIGN_EXPERIMENTAL: 1

- name: Verify the pushed tags
run: cosign verify ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.run_id }} --certificate-identity ${{ env.GH_URL }}/${{ github.repository }}/.github/workflows/quality-trace-container.yaml@refs/heads/main --certificate-oidc-issuer https://token.actions.githubusercontent.com
run: cosign verify ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.run_id }} --certificate-identity ${{ env.GH_URL }}/${{ github.repository }}/.github/workflows/qualitytrace-container.yaml@refs/heads/main --certificate-oidc-issuer https://token.actions.githubusercontent.com
env:
COSIGN_EXPERIMENTAL: 1

Expand All @@ -93,4 +95,4 @@ jobs:
format: 'github'
output: 'dependency-results.sbom.json'
image-ref: '.'
github-pat: ${{ secrets.GITHUB_TOKEN }}
github-pat: ${{ env.registry_password }}
10 changes: 10 additions & 0 deletions dockerfiles/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM alpine

WORKDIR /app

COPY ./qualitytrace /app/qualitytrace

# Adding /app folder on $PATH to allow users to call qualitytrace cli on docker
ENV PATH="$PATH:/app"

ENTRYPOINT ["/app/qualitytrace"]
4 changes: 0 additions & 4 deletions Dockerfile → dockerfiles/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ FROM alpine
WORKDIR /app

COPY ./qualitytrace-server /app/qualitytrace-server
COPY ./qualitytrace /app/qualitytrace

# COPY ./web/build ./html

# Adding /app folder on $PATH to allow users to call qualitytrace cli on docker
ENV PATH="$PATH:/app"

EXPOSE 11633/tcp

ENTRYPOINT ["/app/qualitytrace-server", "serve"]

0 comments on commit 88727ac

Please sign in to comment.