Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/scripts/src/build-image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ async function main() {
});

if (prId) {
const ghClient = await GitHubClient.createWithDefaultCiToken();
const ghClient = await GitHubClient.createWithGithubAppToken({
appId: requiredEnv("_GITHUB_APP_APP_ID"),
installationId: requiredEnv("_GITHUB_APP_INSTALLATION_ID"),
privateKey: requiredEnv("_GITHUB_APP_PEM_CONTENT"),
});

await ghClient.sendPrMessage({
prId: Number(prId),
owner: GITHUB_OWNER,
Expand Down
6 changes: 6 additions & 0 deletions .github/scripts/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ export const GITHUB_OWNER = "Patina-Network";
export const GITHUB_REPOSITORY = "hello-world-grpc-client-java";
const DOCKER_REPOSITORY = "hello-world-client-java";

/** Repo under GITHUB_OWNER that `deploy` opens image-tag PRs against. */
export const K8S_MANIFESTS_REPOSITORY = "k8s-manifests";

export const SONAR_ORGANIZATION = "patina-network";
export const SONAR_PROJECT_KEY = `${GITHUB_OWNER}_${GITHUB_REPOSITORY}`;

export const ARCHITECTURES = ["amd64", "arm64"] as const;
export type Architecture = (typeof ARCHITECTURES)[number];

Expand Down
5 changes: 3 additions & 2 deletions .github/scripts/src/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
dockerRepository,
GITHUB_OWNER,
GITHUB_REPOSITORY,
K8S_MANIFESTS_REPOSITORY,
requiredEnv,
shortSha,
} from "../consts";
Expand Down Expand Up @@ -50,10 +51,10 @@ async function main() {

const repository = dockerRepository();
await ghClient.updateK8sTagWithPR({
manifestRepo: [GITHUB_OWNER, "k8s-manifests"],
manifestRepo: [GITHUB_OWNER, K8S_MANIFESTS_REPOSITORY],
originRepo: [GITHUB_OWNER, GITHUB_REPOSITORY],
kustomizationFilePath: `base/${environment}/${repository}/kustomization.yaml`,
imageName: `patinanetwork/${dockerRepository("arm64")}`,
imageName: `${requiredEnv("DOCKER_HUB_USERNAME")}/${dockerRepository("arm64")}`,
newTag: version,
environment,
});
Expand Down
5 changes: 3 additions & 2 deletions .github/scripts/src/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { SonarScannerClient } from "@tahminator/pipeline";
import { $ } from "bun";

import { exclusions } from "../../../../exclusions";
import { SONAR_ORGANIZATION, SONAR_PROJECT_KEY } from "../consts";

async function main() {
const { sonarToken } = parseCiEnv(process.env);
Expand All @@ -18,9 +19,9 @@ async function main() {
"coverage.jacoco.xmlReportPaths": "target/site/jacoco/jacoco.xml",
"coverage.exclusions": `${exclusions}`,
},
organization: "patina-network",
organization: SONAR_ORGANIZATION,
sourceCodeDir: "src/main/java",
projectKey: "Patina-Network_hello-world-grpc-client-java",
projectKey: SONAR_PROJECT_KEY,
},
run: {
runTestsCmd: $`mvn -B -ntp verify`,
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ jobs:
github.ref_name == 'main' ||
github.event.pull_request.head.repo.full_name == github.repository

permissions:
contents: read
pull-requests: write

strategy:
fail-fast: false
matrix:
Expand Down
Loading