Skip to content

Commit

Permalink
Added supported stages + video demo + started harness prerequisites.
Browse files Browse the repository at this point in the history
  • Loading branch information
SushrutHarness committed May 21, 2024
1 parent 20b981d commit f687b90
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "spinnaker-migration",
"label": "Spinnaker Migration",
"collapsed": false,
"position": 11,
"link": {
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/spinnaker-migration/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ Migration details:
? Do you want to proceed? Yes
INFO[2024-03-04T15:50:41-08:00] Spinnaker migration completed
```

## Video Demo

<iframe width="560" height="315" src="https://www.youtube.com/embed/gkWK3BGpDEU?si=ExGLw9B5Q7h2VMdn" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
23 changes: 22 additions & 1 deletion docs/docs/spinnaker-migration/intro.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
title: Introduction
description: Introduction to the Spinnaker Migration tool. Includes supported Spinnaker stages.
sidebar_position: 1
---

Expand All @@ -10,5 +12,24 @@ This tool was developed by Harness to assist in the migration process from Spinn

This tool is designed for customers, CSMs, and developers who are currently using Spinnaker and wish to migrate their accounts to Harness CD Next Gen.

### Key Components that can be migrated
### Spinnaker stages that can be migrated
The following key components can be migrated using this tool:

| | Stages | Harness | Can we Migrate? | Comments |
| -- | ------------------------- | ----------------- | --------------- | ------------------------------------------------------ |
| 1 | pipeline | Pipeline Chaining | Yes | Can only chain up to 2 pipelines |
| 2 | manualJudgment | Approval | Yes | |
| 3 | checkPreconditions | Shell Script | Yes | Supports Expressions, and Multiple Check preconditions |
| 4 | deleteManifest | Delete | Yes | |
| 5 | evaluateVariables | JEXL Expression | Yes | |
| 6 | wait | Wait | Yes | |
| 7 | deployManifest | Deploy | Yes | |
| 8 | webhook | Custom Webhook | Yes | |
| 9 | findImageFromTags | | Yes | |
| 10 | bake | Bake Plugin | Yes | AMI Baking |
| 11 | jenkins | Jenkins Step | Yes | |
| 12 | findArtifactsFromResource | Shell Script | Yes | |
| 13 | Find Image From Tags | Plugin | Yes | |
| 14 | AWS: invokeLambda | Plugin | Yes | |
| 15 | ShrinkCluster | Plugin | Yes | |
| 16 | ScaleDownCluster | Plugin | Yes |
64 changes: 59 additions & 5 deletions docs/docs/spinnaker-migration/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,67 @@ sidebar_position: 2
Before using the Spinnaker to CD Next Gen migration tool, you must have the following prerequisites:

- Armory Account - Armory Platform | Spinnaker

- Harness Account - AccountID

- Harness Org - default if not provided

- Harness Project - Project_Name

- API Key - Follow instructions at Manage API keys | [Harness Developer Hub](https://developer.harness.io/docs/platform/automation/api/add-and-manage-api-keys/#create-personal-api-keys-and-tokens)

- Environment - Prod, Prod1, or Prod3

## Cloud Providers

Cloud providers can have their own specific prerequisites for migration. Here they are:

### AWS

If you are using the **spinnaker-aws-drone-plugin** for any stages (i.e. Shrinkcluster, Scaledowncluster, Invokelambda) then ensure that there is an AWS secret created at the project level within Harness with the following names:

```
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
```

For information on how to create secrets with Harness, go to [AWS Secrets Manager](https://developer.harness.io/docs/platform/secrets/secrets-management/add-an-aws-secret-manager)

### GCP

Regrettably, Harness lacks native support for triggering pipelines directly via incoming Pub/Sub messages. However, we can work around this limitation by using a custom webhook trigger.

For detailed information about custom webhook triggers, go to [Using Custom Triggers](https://developer.harness.io/docs/platform/triggers/trigger-deployments-using-custom-triggers/)

In this approach, you would need to provision a new GCP Cloud Function that triggers from Pub/Sub topic messages and invokes the custom webhook URL. Below is an example of such a function in Node.js.

```jsx
const fetch = require('node-fetch');

exports.pubsubListener = (event, context) => {
const pubsubMessage = event.data;
const message = Buffer.from(pubsubMessage, 'base64').toString();

console.log(`Received message: ${message}`);

// Define the webhook URL and payload
const webhookUrl = '<https://app.harness.io/gateway/pipeline/api/webhook/custom/Wlke4SU6TAeKwDERALcptQ/v3?accountIdentifier=YOUR_ACCOUNT_ID&orgIdentifier=YOUR_ORG_ID&projectIdentifier=YOUR_PROJECT_ID&pipelineIdentifier=YOUR_PIPELINE_ID&triggerIdentifier=webhook_trigger>';
const payload = {
sample_key: 'sample_value'
};

// Make a POST request to the webhook URL
fetch(webhookUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then(response => {
if (!response.ok) {
throw new Error('Failed to trigger webhook');
}
console.log('Webhook triggered successfully');
return response.json();
})
.catch(error => {
console.error('Error triggering webhook:', error);
});
};
```

0 comments on commit f687b90

Please sign in to comment.