Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
2053af6
adding new folders to exclude
Jan 22, 2025
3ca8bb7
updating the architecture diagrams
Jan 22, 2025
7346bea
adding / moving helper scripts
Jan 22, 2025
088e8f8
moving the base image assests to source-repo
Jan 22, 2025
e97d74c
adjusting buildspec file with new nfs mount location & adding debug logs
Jan 22, 2025
db25f0b
refactoring poky/poky-ami project & esling formatting
Jan 22, 2025
2d81ba4
eslint & jest config refactoring / updates
Jan 22, 2025
a353e78
library version updates & scripts commands ajdustments
Jan 22, 2025
8e20ecf
github workflow adjustment to conform with new script location
Jan 22, 2025
fb04968
deprecating existing/former cdk libraries and test
Jan 22, 2025
047860d
updating package-lock.json
Jan 22, 2025
00c73eb
adding new refactored version of the CDK construct with less dependec…
Jan 22, 2025
bbdbb5a
updated readme
Jan 22, 2025
681a955
updated tests snapshot
Jan 22, 2025
9931fce
eslint reformatting
Jan 22, 2025
b28b0d3
forcing dependency to prevent iam role issue on first run of pipeline
Jan 24, 2025
360ba20
managin eof / eol with lf only (as I'm working o windows and this can…
Jan 24, 2025
4e1281d
updated test due to dependency change
Jan 24, 2025
58edccc
moving build assets script out to avoid deployment in dist
Jan 25, 2025
fbc926a
updating reference to build assets script
Jan 25, 2025
297a3a7
adding execute permission
adadouche Jan 25, 2025
db38393
package.json:
Jan 25, 2025
e2d062c
downsizing codebuild ComputeType to save on cost and because resource…
Jan 25, 2025
5827e52
Normalize all the line endings
adadouche Jan 25, 2025
acc1977
forcing lf endings
Jan 25, 2025
0eab16a
adding docker image file to allow uplaod & zip of source repo via cdk…
Feb 5, 2025
64eea57
variable renaming to improve readability
Feb 5, 2025
16ed448
differentiating ProjectKind from deprecated API
Feb 5, 2025
eda3f91
- code refactoring to remove local archive creation (using assets and…
Feb 5, 2025
46ac2aa
minor comment changes
Feb 5, 2025
a01b026
moving the vmimport bucket class to the deprecated folder
Feb 5, 2025
8089ca1
adjusting the vmimport bucket class import
Feb 5, 2025
e901fff
removing references to VMImportBucket
Feb 5, 2025
274064f
simplifying the build asset script
Feb 5, 2025
3c08b66
excluding the test folder from the dist/build output
Feb 5, 2025
9f2f614
adding excluded folder fom build and eslint
Feb 6, 2025
44adc10
cleanup and relocation of scripts and assets
Feb 6, 2025
c3ccb02
variable renaming to improve readability
Feb 6, 2025
8a5e03a
- variable renaming to improve readability
Feb 6, 2025
7f69595
updating script path
Feb 7, 2025
e18796a
varible renaming to improve readability
Feb 7, 2025
78d4de8
switching to S3 poll trigger
Feb 7, 2025
83cf806
code cleanup
Feb 7, 2025
83b8306
adjusting the readme with additional details
Feb 7, 2025
885401c
function refactoring
Feb 7, 2025
b3d9d3f
improving the doc / readme
Feb 7, 2025
cfcd856
minor change in navigation
Feb 7, 2025
90bbea2
adding the ability to use a custom local source path be used to creat…
Feb 7, 2025
4f53d67
switching to codepipeline_actions.S3Trigger.EVENTS,
Feb 10, 2025
9a0766b
- switching to codepipeline_actions.S3Trigger.EVENTS,
Feb 10, 2025
625c6f4
variable renaming
Feb 10, 2025
df9fa19
- extending create ami script with additional parameters
Feb 10, 2025
660e298
test updates
Feb 10, 2025
137d9db
removing node 18/20 support
Feb 13, 2025
130dea2
removing deprecated code
Feb 13, 2025
8f31c9f
switching to yarn
Feb 13, 2025
2943ee9
switching to yarn
Feb 13, 2025
9eb9467
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 13, 2025
78d8551
fixing shell check
Feb 13, 2025
0fec27d
fixing shell check warnings
Feb 14, 2025
59f8c07
adjusting shell check script path
Feb 14, 2025
b6034de
pre-commit failures fixes
Feb 14, 2025
a75c8f5
pre-commit failures fixes
Feb 14, 2025
8ae5a97
adding a post install script to force dist folder generation on install
Feb 14, 2025
6d7a883
reveerting change
Feb 14, 2025
e27750e
adjusting lifecycle scripts
Feb 19, 2025
3a65fdf
updating to Yarn 2 (v4.6.0)
Feb 19, 2025
022d635
updating to Yarn 2 (v4.6.0)
Feb 19, 2025
6a03831
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 19, 2025
7caef67
adding package-lock for npm compatibility
Feb 19, 2025
04dd3f5
fixing renesas script
Feb 19, 2025
6af7570
doc issue
Feb 25, 2025
6344984
adjusting packge.json with files to include
Feb 25, 2025
fb474d7
adjusting packge.json with files to include
Feb 25, 2025
ffe8cba
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 25, 2025
3f18b5f
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 25, 2025
a22372a
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 25, 2025
df32fa3
refactoring build process
Feb 25, 2025
c63f26d
refactoring build process
Feb 25, 2025
29aec13
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 25, 2025
f3a6646
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 25, 2025
2ee5602
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 25, 2025
a7fad09
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 25, 2025
e55774e
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 25, 2025
80bc2b0
yarnMerge branch 'dev-adadouche' of https://github.com/adadouche/aws4…
Feb 25, 2025
aa97cc0
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Feb 25, 2025
4deeb9a
refactoring build process
Feb 25, 2025
b0e2ad0
refactoring build process
Feb 25, 2025
83fb326
adding vscode settings
Feb 26, 2025
4a55d01
revisiting eslint / jest config to accomodate build change
Feb 26, 2025
a557c17
addressing typedoc issue with incomplete link
Feb 26, 2025
1bc4d9a
removing unused code
Feb 26, 2025
6fa6adf
minor update due to package.json change
Feb 26, 2025
847dec7
adding exclusing in the npmignore
Feb 26, 2025
0a40f56
adding exclusing in the npmignore
Feb 26, 2025
4d63348
merging
adadouche Feb 26, 2025
70c2555
fixing type for environment variables in code pipelines
Feb 26, 2025
93ca82e
adding jest test and fixing output location for pipelines
Mar 26, 2025
59b6867
adding jest test and fixing output location for pipelines
Mar 26, 2025
c2d9c12
Merge branch 'dev-adadouche' of https://github.com/adadouche/aws4embe…
Mar 26, 2025
af177f6
Update doc.yml
adadouche Feb 20, 2025
a64d3d4
Major update to 0.2.0 (#76)
adadouche Feb 24, 2025
a243b24
Major update to 0.2.0 (#76)
adadouche Feb 24, 2025
4c38b98
updating snapshot
Mar 26, 2025
c8642f1
Merge branch 'main' into HEAD
adadouche Mar 26, 2025
43dbe53
updating snapshot and test
Mar 26, 2025
ecf0181
changing target to es2020 instead of ES2020
Mar 27, 2025
93b0ba1
replacing reaplce all with global regexp
Mar 27, 2025
7c44dd6
updating yarn and package lock files
Mar 27, 2025
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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
tab_width = 2
34 changes: 33 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,40 @@
!jest.config.js
!.eslintrc.js
!.prettierrc.js

!lib/**/*.ts
!test/**/*.ts
*.d.ts
node_modules

dist
node_modules

# yarn asset
yarn-install.log
.yarn/*
!.yarn/releases/
!.yarn/plugins/
!.yarn/versions/
!.yarn/sdks/
.pnp.*

# yarn asset
yarn-install.log
.yarn/*
!.yarn/releases/
!.yarn/plugins/
!.yarn/versions/
!.yarn/sdks/
.pnp.*

# yarn asset
yarn-install.log
.yarn/*
!.yarn/releases/
!.yarn/plugins/
!.yarn/versions/
!.yarn/sdks/
.pnp.*

# yarn asset
yarn-install.log
Expand All @@ -28,3 +59,4 @@ cdk.context.json

assets
source-zip
aws4embeddedlinux-cdk-lib-*.tgz
22 changes: 17 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
*.ts
!*.d.ts
.yarn
.github
.vscode
test

# CDK asset staging directory
.cdk.staging
cdk.out
.editorconfig
.gitattributes
.pre-commit-config.yaml
eslint.config.mjs
jest.config.js
typedoc.json
tsconfig.*.json
package-lock.json
yarn.lock

CODE_OF_CONDUCT.md
CONTRIBUTING.md
SECURITY.md
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"eslint.alwaysShowStatus": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"explorer.autoReveal": false
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ npm install aws4embeddedlinux/aws4embeddedlinux-ci
of `yarn':

```bash
yarn add github:aws4embeddedlinux/aws4embeddedlinux-ci
yarn add aws4embeddedlinux-cdk-lib@aws4embeddedlinux/aws4embeddedlinux-ci
yarn install
```

Expand Down Expand Up @@ -254,7 +254,7 @@ const projectPipeline = new EmbeddedLinuxCodePipelineStack(app, "demo-project",
});
```

Refer to the [API Documentation](https://aws4embeddedlinux.github.io/aws4embeddedlinux-ci) and the [sample](github.com/aws4embeddedlinux/aws4embeddedlinux-ci-examples) for more details.
Refer to the [API Documentation](https://aws4embeddedlinux.github.io/aws4embeddedlinux-ci) and the [sample](https://github.com/aws4embeddedlinux/aws4embeddedlinux-ci-examples) for more details.

Once you have completed the code of your application, you can deploy the CDK stack using:

Expand All @@ -275,7 +275,7 @@ This will create an Ubuntu based container for building the Yocto images.

> [!NOTE]
>
> We recommend you to deploy first the 'Base Image' pipeline and once the pipeline completes successfully, then you can deploy the other pipelines in you application as described in the [sample](github.com/aws4embeddedlinux/aws4embeddedlinux-ci-examples).
> We recommend you to deploy first the 'Base Image' pipeline and once the pipeline completes successfully, then you can deploy the other pipelines in you application as described in the [sample](https://github.com/aws4embeddedlinux/aws4embeddedlinux-ci-examples).
>

Once your pipelines completes successfully, the Yocto deploy directory generated content will be pushed into a S3 bucket.
Expand Down
43 changes: 29 additions & 14 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import tsdoc from "eslint-plugin-tsdoc";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintjs from "@eslint/js";
import eslintts from "typescript-eslint";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
Expand All @@ -16,14 +17,22 @@ const gitignorePath = path.resolve(__dirname, ".gitignore");

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: eslint.configs.recommended,
allConfig: eslint.configs.all,
recommendedConfig: eslintjs.configs.recommended,
allConfig: eslintjs.configs.all,
});

export default [
...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
),
...eslintts.configs.recommended,
{
...eslintjs.configs.recommended,
plugins: {
"@typescript-eslint": typescriptEslintEslintPlugin,
"simple-import-sort": simpleImportSort,
tsdoc,
},

Expand All @@ -39,7 +48,7 @@ export default [

parserOptions: {
sourceType: "module",
project: "./tsconfig.json",
project: "./tsconfig.eslint.json",
},
},

Expand All @@ -61,8 +70,21 @@ export default [
"prettier/prettier": [
"error",
{
singleQuote: true,
trailingComma: "es5",
singleQuote: false,
trailingComma: "all",
},
],

"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
Expand All @@ -77,13 +99,6 @@ export default [
"/test/**",
"/tmp/**",
],
...eslint.configs.recommended,
},
includeIgnoreFile(gitignorePath),
...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
),
...tseslint.configs.recommended,
];
9 changes: 0 additions & 9 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
/* eslint-env node */
// module.exports = {
// testEnvironment: "node",
// roots: ["<rootDir>/test"],
// testMatch: ["**/*.test.ts"],
// transform: {
// "^.+\\.tsx?$": "ts-jest",
// },
// };

export const testEnvironment = "node";
export const roots = ["<rootDir>/test"];
export const testMatch = ["**/*.test.ts"];
Expand Down
14 changes: 7 additions & 7 deletions lib/codepipeline-embedded-linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface EmbeddedLinuxCodePipelineProps extends cdk.StackProps {
readonly buildPolicyAdditions?: iam.PolicyStatement[];
/** Additional build environment variables to the build project. */
readonly environmentVariables?: {
string: codebuild.BuildEnvironmentVariable;
[key: string]: codebuild.BuildEnvironmentVariable;
};
/** The encryption key use across*/
readonly encryptionKey: kms.Key;
Expand Down Expand Up @@ -272,12 +272,12 @@ export class EmbeddedLinuxCodePipelineStack extends cdk.Stack {
project,
});

const artifactAction: codepipeline_actions.S3DeployAction =
const outputAction: codepipeline_actions.S3DeployAction =
new codepipeline_actions.S3DeployAction({
actionName: "Artifact",
actionName: "Output",
input: buildActionOutputArtifact,
bucket: props.pipelineArtifactBucket,
objectKey: `${props.pipelineArtifactPrefix}/${sourceRepoAsset.s3ObjectKey}`,
bucket: props.pipelineOutputBucket,
objectKey: `${props.pipelineOutputPrefix}`,
});

/** Here we create the logic to check for presence of ECR image on the CodeCodePipeline automatic triggering upon resource creation,
Expand Down Expand Up @@ -352,8 +352,8 @@ export class EmbeddedLinuxCodePipelineStack extends cdk.Stack {
actions: [buildAction],
},
{
stageName: "Artifact",
actions: [artifactAction],
stageName: "Output",
actions: [outputAction],
},
],
},
Expand Down
15 changes: 0 additions & 15 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
import * as s3 from "aws-cdk-lib/aws-s3";

export * from "./codebuild-embedded-linux";
export * from "./codepipeline-embedded-linux-base-image";
export * from "./codepipeline-embedded-linux";
export * from "./codepipeline-resources";

export function isBucketVersioned(bucket: s3.Bucket | s3.IBucket) {
const bucketCfn: s3.CfnBucket = bucket.node.defaultChild as s3.CfnBucket;
if (
bucketCfn.versioningConfiguration &&
(
bucketCfn.versioningConfiguration as s3.CfnBucket.VersioningConfigurationProperty
).status != "Enabled"
) {
return true;
}
return false;
}

/**
* The type of project built.
*/
Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "aws4embeddedlinux-cdk-lib",
"version": "0.2.0",
"main": "dist/lib/index.js",
"types": "dist/lib/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"scripts": {
"build": "tsc",
Expand All @@ -11,17 +11,12 @@
"doc": "typedoc --sort source-order --readme README.md",
"format": "eslint '**/*.{js,ts,json}' --quiet --fix",
"postinstall": "npm run build > /dev/null || echo 'prepapre command completed successfully with errors'",
"prepare": "npm run build > /dev/null || echo 'prepapre command completed successfully with errors'",
"prepare-commit": "pre-commit run --all-files --color=always --show-diff-on-failure",
"test": "jest",
"update-snapshot": "jest -u",
"watch": "tsc -w",
"postclean": "rm -rf ./dist",
"prebuild": "./utils/build-assets.sh",
"precheck": "yarn clean",
"preformat": "yarn clean",
"pretest": "yarn prebuild",
"preupdate-snapshot": "yarn prebuild"
"preformat": "yarn clean"
},
"dependencies": {
"aws-cdk-lib": "2.176.0",
Expand All @@ -40,6 +35,7 @@
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-tsdoc": "^0.4.0",
"globals": "^15.13.0",
"jest": "^29.7.0",
Expand Down
Loading
Loading