diff --git a/.harness/reactmobapp.yaml b/.harness/reactmobapp.yaml new file mode 100644 index 0000000..53ba93f --- /dev/null +++ b/.harness/reactmobapp.yaml @@ -0,0 +1,117 @@ +pipeline: + name: reactmobapp + identifier: reactmobapp + projectIdentifier: Shell + orgIdentifier: default + tags: {} + properties: + ci: + codebase: + connectorRef: account.fmazlabsgit + repoName: fm-react-sample-app + build: <+input> + stages: + - stage: + name: shellapp + identifier: scan_and_build_react + type: CI + spec: + cloneCodebase: true + platform: + os: Linux + arch: Amd64 + runtime: + type: Cloud + spec: {} + execution: + steps: + - step: + type: Run + name: CreateHash + identifier: CreateHash + spec: + shell: Sh + command: |- + YARN_LOCK_HASH=`openssl sha1 yarn.lock | cut -c 22-` + echo $YARN_LOCK_HASH + description: CreateHash + - step: + type: RestoreCacheS3 + name: Restore Cache From S3 + identifier: Restore_Cache_From_S3 + spec: + connectorRef: account.aws_fm + region: ap-south-1 + bucket: shellpov + key: <+pipeline.stages.shellapp.spec.execution.steps.CreatHash.output.outputVariables.YARN_LOCK_HASH> + archiveFormat: Tar + - step: + type: Security + name: Sonar Scan + identifier: Sonar_Scan + spec: + privileged: true + settings: + policy_type: orchestratedScan + scan_type: repository + product_name: sonarqube + product_config_name: default + repository_project: fm-react-sample-app + repository_branch: <+codebase.branch> + product_access_token: <+secrets.getValue("sonartoken")> + product_domain: http://52.66.59.93:9000 + product_project_name: sonarharness + product_project_key: <+secrets.getValue("sonarharness")> + imagePullPolicy: Always + description: Scan Sonaqube + timeout: 1h + - step: + type: Run + name: Yarn Install + identifier: Yarn_Install + spec: + shell: Sh + command: |- + echo <+pipeline.stages.shellapp.spec.execution.steps.CreatHash.output.outputVariables.YARN_LOCK_HASH> + yarn install --prod + description: Yarn Install + - step: + type: SaveCacheS3 + name: Save Cache to S3 + identifier: Save_Cache_to_S3 + spec: + connectorRef: account.aws_fm + region: ap-south-1 + bucket: shellpov + key: <+pipeline.stages.shellapp.spec.execution.steps.CreateHash.output.outputVariables.YARN_LOCK_HASH> + sourcePaths: + - node_modules + archiveFormat: Tar + - step: + type: Run + name: Yarn build + identifier: Yarn_build + spec: + shell: Sh + command: |- + ls -la + yarn build + description: Yarn Build + sharedPaths: + - /var/run + serviceDependencies: + - identifier: DinD + name: DinD + type: Service + spec: + connectorRef: account.harnessImage + image: docker:dind + - identifier: Hash + name: Hash + type: Service + description: Node Image + spec: + connectorRef: account.harnessImage + image: node:18 + variables: [] + timeout: 10h diff --git a/inputset.yaml b/inputset.yaml new file mode 100644 index 0000000..0075209 --- /dev/null +++ b/inputset.yaml @@ -0,0 +1,14 @@ +inputSet: + name: branch + identifier: branch + orgIdentifier: default + projectIdentifier: Shell + pipeline: + identifier: reactmobapp + properties: + ci: + codebase: + build: + type: branch + spec: + branch: <+trigger.branch> diff --git a/src/index.js b/src/index.js index 87d1be5..5104642 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,7 @@ import * as serviceWorker from './serviceWorker'; ReactDOM.render(, document.getElementById('root')); -// If you want your app to work offline and load faster, you can change +// If you want your app to work offline and load faster, you can change demo5 // unregister() to register() below. Note this comes with some pitfalls. // Learn more about service workers: https://bit.ly/CRA-PWA serviceWorker.unregister();