### Pipeline Example: Maven Installation with Dependency Tracking Source: https://github.com/harness/developer-hub/blob/main/docs/artifact-registry/dependency-firewall/affected-pipelines.md This example shows the necessary Harness CLI commands to authenticate, configure the Maven registry, and install packages with dependency tracking enabled. ```bash hc auth login --api-url https://app.harness.io --api-token $HARNESS_API_TOKEN --account $HARNESS_ACCOUNT_ID hc registry configure maven --registry maven-upstream hc artifact mvn install ``` -------------------------------- ### Pipeline Example: Python Installation with Dependency Tracking Source: https://github.com/harness/developer-hub/blob/main/docs/artifact-registry/dependency-firewall/affected-pipelines.md This example outlines the steps to authenticate with Harness, configure the pip registry, and install Python packages while enabling dependency tracking. ```bash hc auth login --api-url https://app.harness.io --api-token $HARNESS_API_TOKEN --account $HARNESS_ACCOUNT_ID hc registry configure pip --registry pypi-upstream hc artifact pip install ``` -------------------------------- ### Install Go SDK v6 using go get Source: https://github.com/harness/developer-hub/blob/main/docs/feature-management-experimentation/sdks-and-infrastructure/server-side-sdks/go-sdk.md Install the Harness FME Go SDK v6 using the 'go get' command. ```bash go get github.com/splitio/go-client/v6@v6.9.0 ``` -------------------------------- ### Java SDK Getting Started Example Source: https://github.com/harness/developer-hub/blob/main/docs/feature-flags/use-ff/ff-sdks/server-sdks/integrate-feature-flag-with-java-sdk.md This sample demonstrates initializing the Harness Feature Flag client, creating a target with custom attributes, and continuously evaluating a boolean feature flag. Ensure the `FF_API_KEY` and `FF_FLAG_NAME` environment variables are set. ```java package io.harness.ff.examples; import io.harness.cf.client.api.*; import io.harness.cf.client.dto.Target;   import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; public class GettingStarted {     // API Key - set this as an env variable     private static String apiKey = getEnvOrDefault("FF_API_KEY", "");     // Flag Identifier     private static String flagName = getEnvOrDefault("FF_FLAG_NAME", "harnessappdemodarkmode");     private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);     public static void main(String[] args) {         System.out.println("Harness SDK Getting Started");         try {             //Create a Feature Flag Client             CfClient cfClient = new CfClient(apiKey);             cfClient.waitForInitialization();             // Create a target (different targets can get different results based on rules.  This includes a custom attribute 'location')             final Target target = Target.builder()                     .identifier("javasdk")                     .name("JavaSDK")                     .attribute("location", "emea")                     .build();             // Loop forever reporting the state of the flag             scheduler.scheduleAtFixedRate(                     () -> {                         boolean result = cfClient.boolVariation(flagName, target, false);                         System.out.println("Boolean variation is " + result);                     },                     0,                     10,                     TimeUnit.SECONDS);         } catch (Exception e) {             e.printStackTrace();         } finally {             // Close the SDK             CfClient.getInstance().close();         }     }     // Get the value from the environment or return the default     private static String getEnvOrDefault(String key, String defaultValue) {         String value = System.getenv(key);         if (value == null || value.isEmpty()) {             return defaultValue;         }         return value;     } } ``` -------------------------------- ### Pipeline Example: npm Installation with Dependency Tracking Source: https://github.com/harness/developer-hub/blob/main/docs/artifact-registry/dependency-firewall/affected-pipelines.md This example demonstrates how to authenticate with Harness, configure npm to use an upstream proxy registry, and then install packages using the Harness CLI for dependency tracking and firewall evaluation. ```bash # Authenticate with Harness hc auth login \ --api-url https://app.harness.io \ --api-token $HARNESS_API_TOKEN \ --account $HARNESS_ACCOUNT_ID # Configure npm to use your upstream proxy registry hc registry configure npm \ --registry npm-upstream \ --org $ORG \ --project $PROJECT \ --global # Install packages with dependency tracking and firewall evaluation hc artifact npm install ``` -------------------------------- ### Docker Compose Up Output Example Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-delivery/deploy-srv-diff-platforms/community-ed/harness-community-edition-quickstart.md This is an example of the output when starting Harness services with `docker-compose up -d`. ```text [+] Running 13/13 ⠿ Network harness_harness-network Created 0.1s ⠿ Container harness_log-service_1 Started 2.9s ⠿ Container harness_redis_1 Started 2.7s ... ``` -------------------------------- ### Install Go dependencies Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-integration/use-ci/run-step-settings.md This step installs Go dependencies using the `go get` command. Ensure your Go environment is configured correctly. ```yaml - step: type: Run identifier: dependencies name: Dependencies spec: shell: Sh command: | go get example.com/my-go-module ``` -------------------------------- ### Install Dependencies and Run React App Source: https://github.com/harness/developer-hub/blob/main/docs/feature-flags/get-started/typescript-react.md Navigate to the root of the cloned react-store directory and install project dependencies using npm install, then start the application with npm run. Access the running application at http://localhost:3000. ```bash #root of react-store directory npm install npm run ``` -------------------------------- ### Download Air-Gapped Bundles Source: https://github.com/harness/developer-hub/blob/main/release-notes/self-managed-enterprise-edition.md Download all necessary image bundles for air-gapped installations. Ensure the 'smp-airgap-bundles/' directory exists prior to execution. ```bash curl -f -s -L -o smp-airgap-bundles/ccm_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/ccm_images.tgz curl -f -s -L -o smp-airgap-bundles/cdng_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/cdng_images.tgz curl -f -s -L -o smp-airgap-bundles/ce_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/ce_images.tgz curl -f -s -L -o smp-airgap-bundles/cet_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/cet_images.tgz curl -f -s -L -o smp-airgap-bundles/ci_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/ci_images.tgz curl -f -s -L -o smp-airgap-bundles/ff_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/ff_images.tgz curl -f -s -L -o smp-airgap-bundles/platform_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/platform_images.tgz curl -f -s -L -o smp-airgap-bundles/sto_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/sto_images.tgz curl -f -s -L -o smp-airgap-bundles/iacm_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/iacm_images.tgz curl -f -s -L -o smp-airgap-bundles/idp_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.35.17/idp_images.tgz ``` -------------------------------- ### Download Airgap Bundles Source: https://github.com/harness/developer-hub/blob/main/release-notes/self-managed-enterprise-edition.md Download the necessary image bundles for airgapped installations. Ensure the 'smp-airgap-bundles/' directory exists prior to execution. ```bash curl -f -s -L -o smp-airgap-bundles/ccm_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/ccm_images.tgz curl -f -s -L -o smp-airgap-bundles/cdng_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/cdng_images.tgz curl -f -s -L -o smp-airgap-bundles/ce_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/ce_images.tgz curl -f -s -L -o smp-airgap-bundles/cet_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/cet_images.tgz curl -f -s -L -o smp-airgap-bundles/ci_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/ci_images.tgz curl -f -s -L -o smp-airgap-bundles/ff_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/ff_images.tgz curl -f -s -L -o smp-airgap-bundles/platform_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/platform_images.tgz curl -f -s -L -o smp-airgap-bundles/sto_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/sto_images.tgz curl -f -s -L -o smp-airgap-bundles/iacm_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/iacm_images.tgz curl -f -s -L -o smp-airgap-bundles/idp_images.tgz https://app.harness.io/public/harness-airgap-bundle/harness-0.34.0/idp_images.tgz ``` -------------------------------- ### Download Air Gap Bundles with gsutil Source: https://github.com/harness/developer-hub/blob/main/release-notes/self-managed-enterprise-edition.md Use this command to download air gap bundles if you do not have Google account access. Ensure `gsutil` is installed and configured. ```bash gsutil -m cp \ "gs://smp-airgap-bundles/harness-0.35.1/ccm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.1/cdng_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.1/ce_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.1/cet_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.1/ci_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.1/ff_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.1/platform_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.1/sto_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.1/iacm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.1/idp_images.tgz" \ . ``` -------------------------------- ### Example Validation Path for GET Request Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-delivery/verify/configure-cv/health-sources/loki.md This is an example validation path for a GET request when configuring a Grafana Loki connector. Ensure the path is correct for your Grafana Loki setup. ```text loki/api/v1/labels ``` -------------------------------- ### Setup Golang using GitHub Action Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-integration/use-ci/use-drone-plugins/ci-github-action-step.md Use the `actions/setup-go` GitHub Action to set up a Go environment. This example configures Go version 1.17. ```yaml - step: type: Action name: setup golang identifier: setup_go spec: uses: actions/setup-go@v3 with: go-version: "1.17" ``` -------------------------------- ### Sample SDK Initialization Source: https://github.com/harness/developer-hub/blob/main/docs/feature-flags/use-ff/ff-sdks/client-sdks/ios-sdk-reference.md A complete example demonstrating SDK initialization with a configuration and target, including a callback to handle the initialization result. ```swift let configuration = CfConfiguration.builder().setStreamEnabled(true).build() let target = CfTarget.builder().setIdentifier("Harness_Target_1").build() CfClient.sharedInstance.initialize(apiKey: "YOUR_API_KEY", configuration: configuration, target: target) { (result) in switch result { case .failure(let error): //Do something to gracefully handle initialization/authorization failure case .success: //Continue to the next step after successful initialization/authorization } } ``` -------------------------------- ### Extracting Substring from a Variable in Harness Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-delivery/kb-articles/faqs.md The substring function allows extraction of a portion of a string using start and end indices. This example gets 'prod' from 'prod-environment-variable'. ```harness <+<+pipeline.variables.envVar>.substring(0,3)> ``` -------------------------------- ### Self-managed Pipeline Example with S3 Cache Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-integration/development-guides/ci-windows.md This example is for a self-managed CI pipeline using S3 for cache restoration. Replace placeholders for connectors, repository, AWS details, and Kubernetes namespace. It includes steps for dependency installation and tool setup. ```yaml pipeline: name: default identifier: default projectIdentifier: default orgIdentifier: default properties: ci: codebase: connectorRef: YOUR_CODE_REPO_CONNECTOR_ID repoName: YOUR_REPO_NAME build: <+input> tags: {} pipeline: name: default identifier: default projectIdentifier: default orgIdentifier: default properties: ci: codebase: connectorRef: YOUR_CODE_REPO_CONNECTOR_ID repoName: YOUR_REPO_NAME build: <+input> tags: {} stages: - stage: name: build and test identifier: build_and_test type: CI spec: cloneCodebase: true execution: steps: - step: type: RestoreCacheS3 name: Restore Cache From S3 identifier: Restore_Cache_From_S3 spec: connectorRef: YOUR_AWS_CONNECTOR_ID region: us-east-1 bucket: YOUR_S3_BUCKET key: cache-{{ checksum "packages.lock.json" }} archiveFormat: Tar - step: type: Run identifier: dependencies name: Dependencies spec: connectorRef: YOUR_IMAGE_REGISTRY_CONNECTOR image: mcr.microsoft.com/dotnet/sdk:7.0 shell: Powershell command: |- dotnet add package Newtonsoft.json --version 12.0.1 - step: type: Run identifier: install_converter name: install converter spec: connectorRef: YOUR_IMAGE_REGISTRY_CONNECTOR image: mcr.microsoft.com/dotnet/sdk:6.0 ``` -------------------------------- ### Sample SDK Initialization with Cache and Target Source: https://github.com/harness/developer-hub/blob/main/docs/feature-flags/use-ff/ff-sdks/server-sdks/apex-sdk-reference.md A complete example of initializing the SDK, including setting up cache, configuration, and target properties before creating the FFClient instance. ```java // Set flagKey to the feature flag key you want to evaluate. String flag = 'harnessappdemodarkmode'; // set cache Namespace and Partition FFOrgCache cache = new FFOrgCache('local', 'basic'); FFConfig config = new FFConfig.builder().cache(cache).build();  // Set up the target properties. FFTarget target = FFTarget.builder().identifier('Harness').name('Harness').build(); FFClient client = new FFClient('Your SDK Key', target, config); ``` -------------------------------- ### Download Air Gap Bundles using gsutil Source: https://github.com/harness/developer-hub/blob/main/release-notes/self-managed-enterprise-edition.md Use this command to download air gap bundles for Harness 0.14.5 if you do not have Google account access. Ensure gsutil is installed and configured. ```bash gsutil -m cp \ "gs://smp-airgap-bundles/harness-0.14.5/ccm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.14.5/cdng_images.tgz" \ "gs://smp-airgap-bundles/harness-0.14.5/ce_images.tgz" \ "gs://smp-airgap-bundles/harness-0.14.5/cet_images.tgz" \ "gs://smp-airgap-bundles/harness-0.14.5/ci_images.tgz" \ "gs://smp-airgap-bundles/harness-0.14.5/ff_images.tgz" \ "gs://smp-airgap-bundles/harness-0.14.5/platform_images.tgz" \ "gs://smp-airgap-bundles/harness-0.14.5/sto_images.tgz" \ . ``` -------------------------------- ### Sample TAS Manifest with Routes Source: https://github.com/harness/developer-hub/blob/main/release-notes/self-managed-enterprise-edition.md Provides an example of how to define routes as variables within a TAS manifest. This requires Harness Delegate version 23.08.80104 or later. ```yaml applications: - name: ((NAME)) memory: 500M instances: 1 routes: ((ROUTES)) ``` -------------------------------- ### Full Go Application Integration Example Source: https://github.com/harness/developer-hub/blob/main/docs/feature-flags/use-ff/ff-sdks/server-sdks/feature-flag-sdks-go-application.md A comprehensive example demonstrating the initialization of the Harness Go SDK with custom configurations, including logger, pull interval, and stream settings. It also shows how to create a target and continuously evaluate a feature flag. ```go package main import ( "context" "fmt" "log" "time" harness "github.com/harness/ff-golang-server-sdk/client" "github.com/harness/ff-golang-server-sdk/dto" "github.com/sirupsen/logrus" ) const sdkKey = "your SDK key" const featureFlag = "harnessappdemodarkmode" func main() { logger := logrus.New() logger.SetLevel(logrus.ErrorLevel) client, err := harness.NewCfClient(myApiKey, harness.WithURL("https://config.ff.harness.io/api/1.0"), harness.WithEventsURL("https://events.ff.harness.io/api/1.0”), harness.WithPullInterval(1), harness.WithLogger(logger), harness.WithStreamEnabled(false) ) defer func() { if err := client.Close(); err != nil { log.Printf("error while closing client err: %v", err) } }() if err != nil { log.Printf("could not connect to CF servers %v", err) } target := dto.NewTargetBuilder("HT_1"). Name("Harness_Target_1"). Custom("email", "demo@harness.io"). Build() ctx, cancel := context.WithCancel(context.Background()) go func() { for { select { case <-ctx.Done(): return default: showFeature, err := client.BoolVariation(featureFlag, &target, false) if err != nil { fmt.Printf("Error getting value: %v", err) } fmt.Printf("KeyFeature flag '%s' is %t for this user\n", featureFlag, showFeature) time.Sleep(10 * time.Second) } } }() time.Sleep(5 * time.Minute) cancel() } ``` -------------------------------- ### Pytest with Test Intelligence in Test step Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-integration/use-ci/run-tests/test-report-ref.md Execute pytest with Test Intelligence in a Harness Test step. This example includes environment setup, dependency installation, and JUnit XML report generation. ```yaml - step: type: Test name: Intelligent Tests identifier: test spec: command: | python3 -m venv .venv . .venv/bin/activate python3 -m pip install -r requirements/test.txt python3 -m pip install -e . pytest --junitxml=out_report.xml shell: Python ... reports: - out_report.xml* ``` -------------------------------- ### Download Air Gap Bundles with gsutil Source: https://github.com/harness/developer-hub/blob/main/release-notes/self-managed-enterprise-edition.md Use this command to download air gap bundle images using `gsutil`. Ensure `gsutil` is installed and configured. ```bash gsutil -m cp \ "gs://smp-airgap-bundles/harness-0.36.0/ccm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.36.0/cdng_images.tgz" \ "gs://smp-airgap-bundles/harness-0.36.0/ce_images.tgz" \ "gs://smp-airgap-bundles/harness-0.36.0/cet_images.tgz" \ "gs://smp-airgap-bundles/harness-0.36.0/ci_images.tgz" \ "gs://smp-airgap-bundles/harness-0.36.0/ff_images.tgz" \ "gs://smp-airgap-bundles/harness-0.36.0/platform_images.tgz" \ "gs://smp-airgap-bundles/harness-0.36.0/sto_images.tgz" \ "gs://smp-airgap-bundles/harness-0.36.0/iacm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.36.0/idp_images.tgz" \ . ``` -------------------------------- ### Example Helm Installation Source: https://github.com/harness/developer-hub/blob/main/docs/self-managed-enterprise-edition/cloud-providers/install-in-gcp.md An example of how to run the `helm install` command with specific values for release name, directory, namespace, and override file. ```bash helm install test-release harness/ -n smp-test -f harness/override-demo.yaml ``` -------------------------------- ### Setup Ruby using GitHub Action Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-integration/use-ci/use-drone-plugins/ci-github-action-step.md Use the `ruby/setup-ruby` GitHub Action to set up a Ruby environment. This example specifies Ruby version 2.7.2. ```yaml - step: type: Action name: setup ruby identifier: setup_ruby spec: uses: ruby/setup-ruby@v1 with: ruby-version: "2.7.2" ``` -------------------------------- ### Download Air Gap Bundles using gsutil Source: https://github.com/harness/developer-hub/blob/main/release-notes/self-managed-enterprise-edition.md Use this command to download air gap bundles for Harness version 0.35.17 using gsutil. Ensure gsutil is installed and configured. ```bash gsutil -m cp \ "gs://smp-airgap-bundles/harness-0.35.17/ccm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.17/cdng_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.17/ce_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.17/cet_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.17/ci_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.17/ff_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.17/platform_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.17/sto_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.17/iacm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.17/idp_images.tgz" \ . ``` -------------------------------- ### Setup Java using GitHub Action Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-integration/use-ci/use-drone-plugins/ci-github-action-step.md Use the `actions/setup-java` GitHub Action to configure a Java environment. This example sets up Java 17 using the Temurin distribution. ```yaml - step: type: Action name: setup java identifier: setup_java spec: uses: actions/setup-java@v3 with: distribution: "temurin" java-version: "17" ``` -------------------------------- ### Download Air Gap Bundles using gsutil Source: https://github.com/harness/developer-hub/blob/main/release-notes/self-managed-enterprise-edition.md Use this command to download air gap bundles from Google Cloud Storage. Ensure `gsutil` is installed and configured. ```bash gsutil -m cp \ "gs://smp-airgap-bundles/harness-0.35.2/ccm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.2/cdng_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.2/ce_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.2/cet_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.2/ci_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.2/ff_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.2/platform_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.2/sto_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.2/iacm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.2/idp_images.tgz" \ . ``` -------------------------------- ### Complete Example Workflow (Groovy DSL) Source: https://github.com/harness/developer-hub/blob/main/docs/artifact-registry/build-plugins/content/gradle-plugin.md A full example demonstrating the integration of the Harness Gradle Plugin with Java, Maven Publish, and configuration in a build.gradle file. ```groovy plugins { id 'java' id 'maven-publish' id 'io.harness.gradle' version '1.0.0' } group = 'com.example' version = '1.0.0' publishing { publications { mavenJava(MavenPublication) { from components.java } } } harnesspublish { apiUrl = System.getenv("DEPLOY_REPO_URL") ?: "" username = System.getenv("DEPLOY_USERNAME") ?: "" token = System.getenv("DEPLOY_TOKEN") ?: "" } ``` -------------------------------- ### Install Go Package with go get Source: https://github.com/harness/developer-hub/blob/main/docs/artifact-registry/content/supported-formats/go-quickstart.md Install your published Go package using the standard `go get` command. Specify the artifact name and version. ```bash go get @ ``` -------------------------------- ### Start Development Server Source: https://github.com/harness/developer-hub/blob/main/docs/internal-developer-portal/plugins/custom-plugins/custom-plugins-v2.md Start the development server for live preview of your custom plugin. Keep this running while developing. ```bash npm run dev ``` -------------------------------- ### GitHub App Installation ID Example Source: https://github.com/harness/developer-hub/blob/main/docs/platform/connectors/code-repositories/ref-source-repo-provider/git-hub-connector-settings-reference.md Find the GitHub Installation ID in the URL when viewing your installed GitHub App. ```html https://github.com/settings/installations/INSTALLATION_ID ``` -------------------------------- ### Download Air Gap Bundles with gsutil Source: https://github.com/harness/developer-hub/blob/main/release-notes/self-managed-enterprise-edition.md Use this command to download air gap bundles from Google Cloud Storage using `gsutil`. Ensure `gsutil` is installed and configured. ```bash gsutil -m cp \ "gs://smp-airgap-bundles/harness-0.35.10/ccm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.10/cdng_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.10/ce_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.10/cet_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.10/ci_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.10/ff_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.10/platform_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.10/sto_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.10/iacm_images.tgz" \ "gs://smp-airgap-bundles/harness-0.35.10/idp_images.tgz" \ . ``` -------------------------------- ### Example Output: Download Manifests Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-delivery/deploy-srv-diff-platforms/azure/azure-container-apps/basic-deployment.md Shows the output path where manifests are downloaded and staged for use in subsequent deployment steps. ```text Download Path: /harness/m1 Creating file : /harness/m1/acaManifest ``` -------------------------------- ### Get Stage Start Timestamp Source: https://github.com/harness/developer-hub/blob/main/docs/open-source/reference/pipelines/shell_variables.md Provides the unix timestamp for when the pipeline was started by the runner. ```bash DRONE_STAGE_STARTED=915148800 ``` -------------------------------- ### Example CI/CD Workflow Setup Source: https://github.com/harness/developer-hub/blob/main/docs/artifact-registry/build-plugins/content/maven-plugin.md Set deployment credentials as environment variables for use in a CI/CD pipeline, including the Harness token. ```bash # Set deployment credentials export DEPLOY_REPO_URL="https://pkg.harness.io/pkg/abc123/my-maven-registry/maven" export DEPLOY_USERNAME="harness-user" export DEPLOY_TOKEN="${HARNESS_TOKEN}" ``` -------------------------------- ### Example: Get secret value Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-delivery/x-platform-cd-features/services/cd-services-config-files.md An example of retrieving a secret value with the identifier 'account.MySecretFileIdentifier'. ```harness <+secrets.getValue("account.MySecretFileIdentifier")> ``` -------------------------------- ### Complete Service Onboarding Workflow Example Source: https://github.com/harness/developer-hub/blob/main/docs/internal-developer-portal/tutorials/how-to-use-catalog-ingestion-api.md A full example of a service onboarding workflow template using Backstage's scaffolder. It includes parameters for service details and a step to trigger a Harness custom pipeline, utilizing the 'projectName' fetched via EntityFieldPicker. ```YAML ### Complete Example of a service onboarding workflow.yaml apiVersion: scaffolder.backstage.io/v1beta3 kind: Template # some metadata about the template itself metadata: name: react-app title: Create a new service description: A workflow to create a new service tags: - nextjs - react - javascript # these are the steps which are rendered in the frontend with the form input spec: owner: debabrata.panigrahi@harness.io type: service parameters: - title: Service Details required: - template_type - public_template_url - owner properties: template_type: title: Type of the Template type: string description: Type of the Template public_template_url: title: Give a Public template URL type: string description: Give a Public Cookiecutter Template projectName: title: Project-Name type: string description: Name of the project in JIRA ui:field: EntityFieldPicker ui:displayField: metadata.projectName ui:options: catalogFilter: kind: - Component - Service # This field is hidden but needed to authenticate the request to trigger the pipeline token: title: Harness Token type: string ui:widget: password ui:field: HarnessAuthToken # here's the steps that are executed in series in the scaffolder backend steps: - id: trigger name: Creating your react app action: trigger:harness-custom-pipeline input: url: "Your PIPELINE URL" inputset: project_name: ${{ parameters.projectName }} template_type: ${{ parameters.template_type }} public_template_url: ${{ parameters.public_template_url }} apikey: ${{ parameters.token }} # some outputs which are saved along with the job for use in the frontend output: links: - title: Pipeline Details url: ${{ steps.trigger.output.PipelineUrl }} ``` -------------------------------- ### Start minikube Source: https://github.com/harness/developer-hub/blob/main/docs/platform/get-started/tutorials/install-delegate.md Starts a minikube instance with specified memory and CPU resources. This is a prerequisite for Kubernetes-based installations. ```bash minikube start --memory 4g --cpus 4 ``` -------------------------------- ### Clone Example Apps Repository Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-delivery/get-started/tutorials/kubernetes-container-deployments/ownapp.md Clone the Harness example applications repository and navigate to the GitOps directory for this tutorial. ```bash git clone https://github.com/GITHUB_ACCOUNTNAME/harnesscd-example-apps.git cd harnesscd-example-apps/deploy-own-app/gitops ``` -------------------------------- ### Example: Get Base64-encoded config file Source: https://github.com/harness/developer-hub/blob/main/docs/continuous-delivery/x-platform-cd-features/services/cd-services-config-files.md An example of referencing a Base64-encoded config file with the identifier 'cf_file'. ```harness <+configFile.getAsBase64("cf_file")> ``` -------------------------------- ### Run apt-get update before install Source: https://github.com/harness/developer-hub/blob/main/release-notes/continuous-integration.md If your pipeline installs packages using apt-get install, you must run apt-get update before the install command to refresh the package index. This example shows the correct sequence. ```yaml - step: type: Run name: Install dependencies spec: shell: Sh command: | sudo apt-get update sudo apt-get install -y ``` -------------------------------- ### Serve Documentation Locally with MkDocs Source: https://github.com/harness/developer-hub/blob/main/docs/internal-developer-portal/catalog/integrate-tools/techdocs/working-with-techdocs-locally.md Starts the basic MkDocs local development server. Requires an mkdocs.yml file in the current directory. Access documentation at http://localhost:8000. ```sh mkdocs serve ```