koops-core

A Kotlin DSL for devops

License

License

GroupId

GroupId

com.codingue.koops
ArtifactId

ArtifactId

koops-core
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

koops-core
A Kotlin DSL for devops
Project URL

Project URL

https://github.com/amelki/koops
Source Code Management

Source Code Management

http://github.com/amelki/koops/tree/master

Download koops-core

How to add to project

<!-- https://jarcasting.com/artifacts/com.codingue.koops/koops-core/ -->
<dependency>
    <groupId>com.codingue.koops</groupId>
    <artifactId>koops-core</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.codingue.koops/koops-core/
implementation 'com.codingue.koops:koops-core:0.0.1'
// https://jarcasting.com/artifacts/com.codingue.koops/koops-core/
implementation ("com.codingue.koops:koops-core:0.0.1")
'com.codingue.koops:koops-core:jar:0.0.1'
<dependency org="com.codingue.koops" name="koops-core" rev="0.0.1">
  <artifact name="koops-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.codingue.koops', module='koops-core', version='0.0.1')
)
libraryDependencies += "com.codingue.koops" % "koops-core" % "0.0.1"
[com.codingue.koops/koops-core "0.0.1"]

Dependencies

compile (4)

Group / Artifact Type Version
com.codingue.koops : koops-common jar 0.0.1
org.jetbrains.kotlin : kotlin-stdlib jar 1.2.31
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.2.31
com.fasterxml.jackson.module : jackson-module-kotlin jar 2.9.5

Project Modules

There are no modules declared in this project.

Kotlin Ops

Purpose

Koops is Kotlin-based scripting language aimed at running command line tools commonly used in devops day-to-day work, such as maven, gradle, docker, git, AWS SDK, Google Cloud SDK etc.

It's an alternative to python or bash scripting, combining a simple way of calling commands with the power of the Kotlin language.

Getting Started

Here is an example of a koops script:

#!/usr/bin/env kscript

import com.codingue.koops.core.*
import com.codingue.koops.maven.*
import com.codingue.koops.aws.*
import com.codingue.koops.aws.lambda.*
import com.codingue.koops.aws.s3.*

script {
	// Run mvn clean install command, making sure the build is successful
	mvn(Clean, Install) verifies Success
	// If the build is successful, upload to S3
	aws s3 {
		putObject("mybucket", "target/myproject.jar")
	}
	// And update our lambda with the uploaded content
	aws lambda {
		val updateFunctionCodeResult = updateFunctionCode("mylambda") {
			s3Bucket = "mybucket"
			s3Key = "myproject.jar"
		}
		publishVersion("mylambda", {
			codeSha256 = updateFunctionCodeResult.codeSha256
		})
	}
}

Installation

Any koops snippet being a Kotlin snippet, you can run it in any regular Kotlin program, just like this one.

But more interestingly, you can run koops as a simple Kotlin script, using kscript.

The easiest is to install Kotlin, Kscript and Koops using sdkman:

curl -s "https://get.sdkman.io" | bash              # install sdkman
source ~/.bash_profile                              # add sdkman to PATH

sdk install kotlin                                  # install Kotlin
sdk install maven                                   # install Maven
sdk install kscript                                 # install Kscript

curl -s "http://get.koops.codingue.com" | bash      # install koops extension for kscript

You can then run any .kts script:

koops -s <script.kts>

License

The source files found in this project are licensed under the Apache License 2.0.

Versions

Version
0.0.1