Skip to content

Instantly share code, notes, and snippets.

@vkbansal
Created August 1, 2022 06:59
Show Gist options
  • Save vkbansal/456d99002e5b9f5b864855482b1d50f4 to your computer and use it in GitHub Desktop.
Save vkbansal/456d99002e5b9f5b864855482b1d50f4 to your computer and use it in GitHub Desktop.
Harness blog snippet - Cypress CI YAML 1
execution:
steps:
- step:
type: Run
name: Build
identifier: Build
spec:
connectorRef: myDockerConnector
image: node:16
shell: Sh
command: |-
export CI=true
yarn build # build command
# exporting commit info
echo "COMMIT_INFO_BRANCH=$(git rev-parse --abbrev-ref HEAD)" > commit_info
echo "COMMIT_INFO_SHA=$(git show -s --pretty=%H)" >> commit_info
echo "COMMIT_INFO_REMOTE=$(git config --get remote.origin.url)" >> commit_info
echo "COMMIT_INFO_MESSAGE=$(git show -s --pretty=%B)" >> commit_info
echo "COMMIT_INFO_AUTHOR=$(git show -s --pretty=%an)" >> commit_info
echo "COMMIT_INFO_EMAIL=$(git show -s --pretty=%ae)" >> commit_info
resources:
limits:
memory: 8Gi
cpu: 4000m
- step:
type: BuildAndPushDockerRegistry
name: Docker Push
identifier: Docker_Push
spec:
connectorRef: myDockerConnector
repo: myorg/cypress-test
tags:
- run-<+pipeline.sequenceId>
dockerfile: Dockerfile
resources:
limits:
memory: 4Gi
cpu: 2000m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment