harness-migrate

command module
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

harness-migrate is a command line utility to help convert and migrate continuous integration pipelines from other providers to Harness CI.

Please review known conversion and migration issues before using this tool.

Install on Mac

Intel CPU

curl -L https://github.com/harness/harness-migrate/releases/latest/download/harness-migrate-darwin-amd64.tar.gz | tar zx

Apple silicon (M1 or M2) CPU

curl -L https://github.com/harness/harness-migrate/releases/latest/download/harness-migrate-darwin-arm64.tar.gz | tar zx

Copy the binary into place

sudo cp harness-migrate /usr/local/bin

Verify the install

harness-migrate --help

Build

$ git clone https://github.com/harness/harness-migrate.git
$ cd harness-migrate
$ go build

Usage

Drone

Convert a drone pipeline:

harness-migrate drone convert /path/to/.drone.yml

Export a github namespace from drone:

harness-migrate drone export \
  --namespace example \
  --github-token $GITHUB_TOKEN \
  export.json

❗ To avoid pipelines triggering in both your Drone instance and in Harness CI, you must first deactivate the pipelines in your Drone instance.

This script uses jq and the Drone CLI to disable all pipelines defined in your export.json:

#!/bin/bash

DRONE_NAMESPACE=$(jq -r .name export.json)
for REPO_NAME in $(jq -r .project[].name export.json); do
  drone repo disable $DRONE_NAMESPACE/$REPO_NAME
done

Import a drone namespace:

harness-migrate drone import \
  --harness-account $HARNESS_ACCOUNT \
  --harness-org example \
  --docker-connector account.harnessImage \
  --github-token $GITHUB_TOKEN \
  export.json

CircleCI

Convert a circle pipeline:

harness-migrate circle convert /path/to/.circle/config.yml

GitHub Actions

Convert a github pipeline:

harness-migrate github convert /path/to/.github/workflows/main.yml

GitLab

Convert a gitlab pipeline:

harness-migrate gitlab convert /path/to/.gitlab-ci.yml

Terraform

Generate terraform configuration from an export, and apply it to your Harness account:

$ harness-migrate terraform \
  --account $HARNESS_ACCOUNT \
  --docker-connector account.harnessImage \
  --org $HARNESS_ORG \
  --repo-connector $HARNESS_REPO_CONNECTOR \
  export.json \
  output.tf
$ terraform init
$ terraform apply

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal
harness
Package harness provides a Harness http client.
Package harness provides a Harness http client.
migrate/circle
Package circle provides automatic migration tools from Circle to Harness.
Package circle provides automatic migration tools from Circle to Harness.
migrate/circle/client
Package client provides a Circle http client.
Package client provides a Circle http client.
migrate/drone
Package drone provides automatic migration tools from Drone to Harness.
Package drone provides automatic migration tools from Drone to Harness.
migrate/github
Package github provides automatic migration tools from Github to Harness.
Package github provides automatic migration tools from Github to Harness.
migrate/gitlab
Package gitlab provides automatic migration tools from GitLab to Harness.
Package gitlab provides automatic migration tools from GitLab to Harness.
migrate/travis
Package travis provides automatic migration tools from Travis to Harness.
Package travis provides automatic migration tools from Travis to Harness.
slug
Package slug provides utilities for working with slug values.
Package slug provides utilities for working with slug values.
types
Package types provides common types for data export and import.
Package types provides common types for data export and import.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL