Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
fix: case error (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
arantespp authored Feb 24, 2022
1 parent f53c384 commit 95be09c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cicd/carlin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { secrets } from './secrets';

export default {
pipelines: ['pr', 'main', 'tag'],
pipelines: ['pr', 'main'],
slackWebhookUrl: secrets.slackWebhookUrl,
sshKey: './ssh-key',
sshUrl: '[email protected]:ttoss/carlin.git',
Expand Down
3 changes: 2 additions & 1 deletion cicd/commands/main
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

yarn lerna run "build" --stream
yarn lerna run "test" --stream
yarn lerna version --yes
yarn lerna version --yes
yarn lerna run "deploy" --stream
5 changes: 0 additions & 5 deletions cicd/commands/tag

This file was deleted.

8 changes: 2 additions & 6 deletions packages/cli/src/deploy/staticApp/staticApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const removeOldVersions = async ({ bucket }: { bucket: string }) => {
const versions = CommonPrefixes?.map(({ Prefix }) =>
Prefix?.replace('/', ''),
)
.filter((version) => !!version)
.filter((version) => semver.valid(version))
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
.sort((a, b) => (semver.gt(a!, b!) ? -1 : 1));

Expand Down Expand Up @@ -233,7 +233,6 @@ export const deployStaticApp = async ({
hostedZoneName,
region,
skipUpload,
invalidate = false,
}: {
acm?: string;
aliases?: string[];
Expand All @@ -243,7 +242,6 @@ export const deployStaticApp = async ({
hostedZoneName?: string;
region: string;
skipUpload?: boolean;
invalidate?: boolean;
}) => {
try {
const { stackName } = await handleDeployInitialization({ logPrefix });
Expand Down Expand Up @@ -272,9 +270,7 @@ export const deployStaticApp = async ({

const { Outputs } = await deploy({ params, template });

if (invalidate) {
await invalidateCloudFront({ outputs: Outputs });
}
await invalidateCloudFront({ outputs: Outputs });

if (!skipUpload) {
await removeOldVersions({ bucket });
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/src/utils/getProjectName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export const getProjectName = () => {

const name = getPackageName();

/**
* This case happens when user executes `carlin` outside of project.
* Even commands like `carlin --help` raise an error.
*/
if (!name) {
return '';
}

try {
return pascalCase(name.split(/[@/]/)[1]);
} catch (err) {
Expand Down
2 changes: 0 additions & 2 deletions packages/website/carlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ environments:
Production:
aliases:
- carlin.ttoss.dev
csp:
default-src: ["* 'unsafe-inline' 'unsafe-eval'", replace]
cloudfront: true
skipDeploy: false
stackName: CarlinWebsite

0 comments on commit 95be09c

Please sign in to comment.