hiroyuki-sato/digdag-plugin-ssh


Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.hiroyuki-sato:digdag-plugin-ssh:0.2.0'
	}
	dependencies {
		implementation("com.github.hiroyuki-sato:digdag-plugin-ssh:0.2.0")
	}
	<dependency>
	    <groupId>com.github.hiroyuki-sato</groupId>
	    <artifactId>digdag-plugin-ssh</artifactId>
	    <version>0.2.0</version>
	</dependency>

                            
    libraryDependencies += "com.github.hiroyuki-sato" % "digdag-plugin-ssh" % "0.2.0"
        
        

                            
    :dependencies [[com.github.hiroyuki-sato/digdag-plugin-ssh "0.2.0"]]
        
        

Readme


digdag-plugin-ssh

Digdag ssh> operator plugin to execute a remote command via ssh.

This plugin supports two type of authentications. One is public key authentication(default). The other is password authentication.

Configuration

Release list.

Public key authentication

_export:
  ssh:
    host: host.add.re.ss
    user: username
    stdout_log: true # Output stdout log (default true)
    stderr_log: true # Output stderr log (default false)
  plugin:
    repositories:
      - https://jitpack.io
    dependencies:
      - com.github.hiroyuki-sato:digdag-plugin-ssh:0.1.4 # Modify latest version.

+step1:
  ssh>: ls
#  host: remote.host.name
#  port: 22
#  user: hiroysato

Register private and public key into secrets.

Local mode

digdag secrets --local --set ssh.private_key=@id_rsa
digdag secrets --local --set ssh.public_key=@id_rsa.pub

Server mode

digdag secrets --project <project> --set ssh.private_key=@id_rsa
digdag secrets --project <project> --set ssh.public_key=@id_rsa.pub

Password authentication

digdag secrets --local --set ssh.password=@alice_passwd_file
digdag secrets --local --set ssh.bob_passwd=@bob_passwd_file
_export:
  ssh:
    # global setting
    #host: host.add.re.ss
    #user: username
    stdout_log: true # Output stdout log (default true)
    stderr_log: true # Output stderr log (default false)
    password_auth: true #
  plugin:
    repositories:
      - https://jitpack.io
    dependencies:
      - com.github.hiroyuki-sato:digdag-plugin-ssh:0.1.4 # Modify latest version.

+step1:
  ssh>: ls
  host: remote.host.name
  port: 22
  user: alice
  # `ssh.password` value used by default.

+step2:
  ssh>: another_command
  host: remote.host.name2
  port: 22
  user: bob
  password_override: bob_passwd

Development

1) build

./gradlew publish

Artifacts are build on local repos: ./build/repo.

2) run an example

digdag selfupdate

rm -rf .digdag/plugin
digdag run -a --project sample plugin.dig -p repos=`pwd`/build/repo

Maintainers

  • Hiroyuki Sato(@hiroyuki-sato)
  • Yuki Iwamoto(@yuhiwa)