Skip to content

Commit

Permalink
release ghp
Browse files Browse the repository at this point in the history
  • Loading branch information
kondaurovDev committed Feb 19, 2025
1 parent 1f4daf9 commit 55efe7d
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 76 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/cv-maker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

gtag('config', 'G-FKWW5S34LH');
</script>
<script type="module" crossorigin src="./assets/index-DfIrSN-W.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-Blgfszbd.css">
<script type="module" crossorigin src="./assets/index-CVGpbTpr.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-mEAmrE1W.css">
</head>

<body x-data="state" class="flex flex-col p-16 pt-8 justify-center">
Expand Down
1 change: 0 additions & 1 deletion docs/cv-maker/resume-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
"companyDescription",
"website",
"start",
"end",
"location",
"projects"
],
Expand Down
124 changes: 62 additions & 62 deletions src/cv-maker/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
import { makeS3Client, s3, S3ClientTag } from "#/generated/s3.js"
import { Effect } from "effect"
import { readFile } from "fs/promises";

const deploy =
Effect.gen(function* () {

const bucketName = "kondaurovdev";

yield* s3("create_bucket", {
Bucket: bucketName
}).pipe(
Effect.catchTags({
S3BucketAlreadyOwnedByYou: () => Effect.void
})
);

yield* s3("put_public_access_block", {
Bucket: bucketName,
PublicAccessBlockConfiguration: {
BlockPublicAcls: false,
BlockPublicPolicy: false,
IgnorePublicAcls: false,
RestrictPublicBuckets: false
}
})

const policy = JSON.stringify({
Version: "2012-10-17",
Statement: [{
Sid: "PublicRead",
Effect: "Allow",
Principal: "*",
Action: "s3:GetObject",
Resource: `arn:aws:s3:::${bucketName}/*`,
}],
});

yield* s3("put_bucket_policy", {
Bucket: bucketName,
Policy: policy
}).pipe(
Effect.catchAll(error => Effect.logError("policy error", error))
);

const html = yield* Effect.tryPromise(() => readFile("resume.html"));

yield* s3("put_object", {
Bucket: bucketName,
Key: "kondaurov_resume.pdf",
Body: html
});

})

deploy.pipe(
Effect.provideServiceEffect(S3ClientTag, makeS3Client({
region: "eu-west-1"
})),
Effect.catchAllCause(error => Effect.logError("deploy error", error)),
Effect.runPromise
);
// import { makeS3Client, s3, S3ClientTag } from "#/generated/s3.js"
// import { Effect } from "effect"
// import { readFile } from "fs/promises";

// const deploy =
// Effect.gen(function* () {

// const bucketName = "kondaurovdev";

// yield* s3("create_bucket", {
// Bucket: bucketName
// }).pipe(
// Effect.catchTags({
// S3BucketAlreadyOwnedByYou: () => Effect.void
// })
// );

// yield* s3("put_public_access_block", {
// Bucket: bucketName,
// PublicAccessBlockConfiguration: {
// BlockPublicAcls: false,
// BlockPublicPolicy: false,
// IgnorePublicAcls: false,
// RestrictPublicBuckets: false
// }
// })

// const policy = JSON.stringify({
// Version: "2012-10-17",
// Statement: [{
// Sid: "PublicRead",
// Effect: "Allow",
// Principal: "*",
// Action: "s3:GetObject",
// Resource: `arn:aws:s3:::${bucketName}/*`,
// }],
// });

// yield* s3("put_bucket_policy", {
// Bucket: bucketName,
// Policy: policy
// }).pipe(
// Effect.catchAll(error => Effect.logError("policy error", error))
// );

// const html = yield* Effect.tryPromise(() => readFile("resume.html"));

// yield* s3("put_object", {
// Bucket: bucketName,
// Key: "kondaurov_resume.pdf",
// Body: html
// });

// })

// deploy.pipe(
// Effect.provideServiceEffect(S3ClientTag, makeS3Client({
// region: "eu-west-1"
// })),
// Effect.catchAllCause(error => Effect.logError("deploy error", error)),
// Effect.runPromise
// );

0 comments on commit 55efe7d

Please sign in to comment.