Giter VIP home page Giter VIP logo

dda-pallet-commons's Introduction

dda-pallet-commons

Clojars Project Build Status

Slack | DevOps Hacking with Clojure Meetup DevOps Hacking with Clojure | Website & Blog

Common utils for dda-pallet

compatability

dda-pallet is compatible to the following versions

  • pallet 0.9
  • clojure 1.9

Features

  • Encrypted Credential Managament
  • Utilities for testing pallet plans
  • ServerTest Framework to implement integrtion tests for servers

Use encrypted Credentials

You can encrypt

(ns ...
	(:require
  		[dda.pallet.commons.encrypted-credentials :as crypto]))

(crypto/encrypt
  (crypto/get-public-key
    {:user-home "/home/user/"
     :key-id "-key-id-"})
    {:account "acnt"
     :secret "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})

or decrypt with

(def encrypted-secret
	{:account "acnt",
	 :secret "-----BEGIN PGP MESSAGE-----....-----END PGP MESSAGE-----\n"})

(crypto/decrypt
 (crypto/get-secret-key {:user-home "/home/mje/"
                         :key-id key-id})
   encrypted-secret
   key-passphrase)

See also: https://domaindrivenarchitecture.org/posts/2016-10-24-encrypted-credentials/

Use ServerTest

We typically use remote-whitebox-local-tested method for running server-tests:

  1. Collect facts from remote target systems: We connected by ssh and execute some small bash and provide the result returned.
  2. Parse local: We parse the returned results on CI system.
  3. Test local: We run tests on the parsed information on CI system.

Example for collecting facts - e.g. in settings phase:

(package-fact/collect-packages-fact)

Execute tests - e.g. in test phase:

(package-test/test-installed? "atom")

For complete example see: https://github.com/DomainDrivenArchitecture/dda-managed-vm/blob/master/src/org/domaindrivenarchitecture/pallet/crate/managed_vm.clj or https://github.com/DomainDrivenArchitecture/dda-managed-ide/blob/master/src/org/domaindrivenarchitecture/pallet/crate/managed_ide.clj

Build & Contribute

Setup project with eclipse

In order to do some work on your own, you can add [lein-idefiles "0.2.1"] to your lein plugins and execute

git clone [email protected]:DomainDrivenArchitecture/dda-pallet-commons.git
lein idefiles eclipse

up to now you're ready to start working ...

License

Published under apache2.0 license

dda-pallet-commons's People

Contributors

jerger avatar jankrebs avatar clemensgeibel avatar razum2um avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.