koops-maven

A Kotlin DSL for devops

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.codingue.koops
ArtifactId

ArtifactId

koops-maven
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

koops-maven
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-maven

How to add to project

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

Dependencies

compile (5)

Group / Artifact Type Version
com.codingue.koops : koops-core jar 0.0.1
org.apache.maven.shared : maven-invoker jar 3.0.0
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