Skip to content

Master patch #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
117 changes: 117 additions & 0 deletions .harness/reactmobapp.yaml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions inputset.yaml
Original file line number Diff line number Diff line change
@@ -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>
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as serviceWorker from './serviceWorker';

ReactDOM.render(<App />, 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();