Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyblasczyk committed Oct 12, 2024
1 parent cfd78cd commit dfb5200
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 73 deletions.
3 changes: 2 additions & 1 deletion apps/docs/pages/self-hosted/cloud-providers/google-cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ the official Terraform/Opentofu module. You can customize it to accommodate your
needs.

If you cannot use the Terraform module, you can install Ctrlplane manually to a
GKE cluster and use the [Helm Chart](../methods/kubernetes) based install.
GKE cluster and use the [Helm Chart](../methods/kubernetes#installing-ctrlplane)
based install.

### Using Terraform

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { useRouter } from "next/navigation";
import {
IconAlertTriangle,
IconDotsVertical,
IconLock,
IconReload,
} from "@tabler/icons-react";

import type { Deployment } from "@ctrlplane/db/schema";
import {
AlertDialog,
AlertDialogAction,
Expand Down Expand Up @@ -133,59 +131,11 @@ const ForceReleaseDialog: React.FC<{
);
};

const LockDeployDialog: React.FC<{
release: { id: string; name: string };
deployment: Deployment;
environment: { id: string; name: string };
children: React.ReactNode;
}> = ({ release, deployment, environment, children }) => {
const lockDeploy = api.deployment.update.useMutation();
const router = useRouter();
return (
<AlertDialog>
<AlertDialogTrigger asChild>{children}</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Lock deployment of {release.name} in {environment.name}?
</AlertDialogTitle>
<AlertDialogDescription>
This will prevent any further deployments of this release in the
current environment until unlocked.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter className="flex">
<AlertDialogCancel>Cancel</AlertDialogCancel>
<div className="flex-grow" />
<AlertDialogAction
onClick={() => {
lockDeploy
.mutateAsync({
id: deployment.id,
data: {
lockedEnvironmentIds: [
...deployment.lockedEnvironmentIds,
environment.id,
],
},
})
.then(() => router.refresh());
}}
>
Lock Deploy
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};

export const ReleaseDropdownMenu: React.FC<{
release: { id: string; name: string };
deployment: { id: string };
environment: { id: string; name: string };
isReleaseCompleted: boolean;
}> = ({ release, deployment, environment, isReleaseCompleted }) => (
}> = ({ release, environment, isReleaseCompleted }) => (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
Expand Down Expand Up @@ -216,19 +166,6 @@ export const ReleaseDropdownMenu: React.FC<{
<span>Force deploy</span>
</DropdownMenuItem>
</ForceReleaseDialog>
<LockDeployDialog
release={release}
deployment={deployment}
environment={environment}
>
<DropdownMenuItem
onSelect={(e) => e.preventDefault()}
className="space-x-2"
>
<IconLock className="h-4 w-4" />
<span>Lock Deploy</span>
</DropdownMenuItem>
</LockDeployDialog>
</DropdownMenuContent>
</DropdownMenu>
);
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const Release: React.FC<{
>;
workspaceSlug: string;
systemSlug: string;
deployment: Deployment;
deploymentSlug: string;
}> = (props) => {
const {
name,
Expand All @@ -143,7 +143,7 @@ export const Release: React.FC<{
environment,
workspaceSlug,
systemSlug,
deployment,
deploymentSlug,
} = props;

const latestJobsByTarget = _.chain(releaseJobTriggers)
Expand Down Expand Up @@ -174,15 +174,12 @@ export const Release: React.FC<{
exitedStatus.includes(d.job.status as JobStatus),
);

const deploymentSlug =
firstReleaseJobTrigger?.deployment?.slug ?? deployment.slug;

return (
<div className="flex w-[220px] items-center justify-between px-1">
<HoverCard>
<HoverCardTrigger asChild>
<Link
href={`/${workspaceSlug}/systems/${systemSlug}/deployments/${deploymentSlug}/releases/${firstReleaseJobTrigger?.releaseId}`}
href={`/${workspaceSlug}/systems/${systemSlug}/deployments/${firstReleaseJobTrigger?.deployment?.slug ?? deploymentSlug}/releases/${firstReleaseJobTrigger?.releaseId}`}
className="flex w-full items-center gap-2"
>
<ReleaseIcon releaseJobTriggers={latestJobsByTarget} />
Expand Down Expand Up @@ -244,7 +241,6 @@ export const Release: React.FC<{

<ReleaseDropdownMenu
release={{ id: releaseId, name }}
deployment={deployment}
environment={environment}
isReleaseCompleted={isReleaseCompleted}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const ReleaseCell: React.FC<{
releaseJobTriggers={jc}
workspaceSlug={workspaceSlug}
systemSlug={systemSlug}
deployment={deployment}
deploymentSlug={deployment.slug}
/>
)}

Expand Down

0 comments on commit dfb5200

Please sign in to comment.