1.0.20-master.20190626175436 • Published 7 years ago

@atomist/sdm-pack-clojure v1.0.20-master.20190626175436

Weekly downloads
16
License
Apache-2.0
Repository
github
Last release
7 years ago

@atomist/sdm-pack-clojure

atomist sdm goals npm version

Atomist software delivery machine (SDM) extension pack providing automated creation, building, and delivery of Spring and Spring Boot applications.

See the Atomist documentation for more information on what SDMs are and what they can do for you using the Atomist API for software.

Usage

Install the dependency in your SDM project.

$ npm install @atomist/sdm-pack-clojure

Then use its exported method to add the functionality to your SDM in your machine definition.

import {
    SoftwareDeliveryMachine,
    SoftwareDeliveryMachineConfiguration,
} from "@atomist/sdm";
import {
    createSoftwareDeliveryMachine,
} from "@atomist/sdm-core";
import { LeinSupport } from "@atomist/sdm-pack-clojure";

export function machine(configuration: SoftwareDeliveryMachineConfiguration): SoftwareDeliveryMachine {

    const sdm = createSoftwareDeliveryMachine(
        {
            name: "My Software Delivery Machine",
            configuration,
        },
        whenPushSatisfies(IsLein)
            .itMeans("fingerprint a clojure project")
            .setGoals(LeinDefaultBranchBuildGoals));

    sdm.addExtensionPacks(LeinSupport);
            
    return sdm;
};

Goals

goallong nameclojure project best practice
leinBuildLein buildrun leiningen build and return AppInfo according to leiningen project/version
autofixcljformatrun the cljformat tool on all .clj files
versionlein-versionextract leiningen version, remove any "-SNAPSHOT", add branch-timestamp suffix, and update leiningen project version
dockerBuildlein-docker-builddocker files are located at docker/Dockerfile, image name extracted from project.clj, and current version
publishdeploy-jarrun lein deploy, ensuring that the versioning policy is consistent and project.clj version is in sync with build. Goal includes
a project listener to run our metajar preparation specific to how we construct docker images

Secrets

Secrets required during the build can be baked into each Repo or shared across all of the Repos.

    node node_modules/\@atomist/clj-editors/vault.js create key
    node node_modules/\@atomist/clj-editors/vault.js merge --data '{"CLOJARS_USERNAME": "xxxxx", "CLOJARS_PASSWORD": "xxxxxxx"}'
    node node_modules/\@atomist/clj-editors/vault.js read

The content of the key.txt is made available to running SDMs using the TEAM_CRED environment variable.

Deploying to Clojars

For releases, we add repositories to our leiningen project.clj file

:repositories [["releases" {:url "https://clojars.org/repo"
                              :username :env/clojars_username
                              :password :env/clojars_password
                              :sign-releases false}]]

And encrypt Clojars username/password into our vault.

Deploying Clojure service Docker container to Artifactory

This pack is configured to pick up and use any docker registry referenced in the atomist.config.ts file at sdm.docker.jfrog

{
    "sdm": {
        "docker": {
            "jfrog": {
                "registry": "",
                "user": "",
                "password": ""
            }
        }
    }
}

Support

General support questions should be discussed in the #support channel in the Atomist community Slack workspace.

If you find a problem, please create an issue.

Development

You will need to install Node.js to build and test this project.

Build and test

Install dependencies.

$ npm install

Use the build package script to compile, test, lint, and build the documentation.

$ npm run build

Release

Releases are handled via the Atomist SDM. Just press the 'Approve' button in the Atomist dashboard or Slack.


Created by Atomist. Need Help? Join our Slack workspace.

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-RC.1

7 years ago

0.3.0

7 years ago

0.2.16

7 years ago

0.2.15

7 years ago

0.2.14

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago