Skip to content

Commit

Permalink
Merge branch 'release/1.62.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jelemux committed Jan 30, 2023
2 parents 74f0a3c + 31b837b commit 788460c
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.62.0](https://github.com/cloudogu/ces-build-lib/releases/tag/1.62.0) - 2023-01-30
## Added
- Function lintDockerfile to lint docker files #96.
- Function shellCheck to lint shell scripts #96.

## [1.61.0](https://github.com/cloudogu/ces-build-lib/releases/tag/1.61.0) - 2023-01-13
### Added
- Add output from `kubectl describe` in the summary of the k8s resources in k3d. #94
Expand All @@ -23,7 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [1.59.0](https://github.com/cloudogu/ces-build-lib/releases/tag/1.59.0) - 2022-11-28
### Added
- Function `collectAndArchiveLogs` to collect dogu and resource information to help debugging k3s Jenkins buils. #89
- Function `collectAndArchiveLogs` to collect dogu and resource information to help debugging k3s Jenkins builds. #89
- Function `applyDoguResource(String doguName, String doguNamespace, String doguVersion)` to apply a custom dogu
resource into the cluster. This effectively installs a dogu if it is available. #89

Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ Example:

# Markdown

`Markdown` provides function regardig the `Markdown Files` from the projects docs directory
`Markdown` provides function regarding the `Markdown Files` from the projects docs directory

```groovy
Markdown markdown = new Markdown(this)
Expand All @@ -1151,6 +1151,23 @@ Example:
running a container with the latest https://github.com/tcort/markdown-link-check image
and verifies that the links in the defined project directory are alive

### DockerLint

```groovy
lintDockerfile() // uses Dockerfile as default; optional parameter
```

See [lintDockerFile](vars/lintDockerfile.groovy)

### ShellCheck

```groovy
shellCheck() // search for all .sh files in folder and runs shellcheck
shellCheck(fileList) // fileList="a.sh b.sh" execute shellcheck on a custom list
```

See [shellCheck](vars/shellCheck.groovy)

# Steps

## mailIfStatusChanged
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.cloudogu.ces</groupId>
<artifactId>ces-build-lib</artifactId>
<name>ces-build-lib</name>
<version>1.61.0</version>
<version>1.62.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
8 changes: 8 additions & 0 deletions vars/lintDockerfile.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.cloudogu.ces.cesbuildlib

def call(String dockerfile = "Dockerfile") {
// only latest version available
docker.image('projectatomic/dockerfile-lint:latest').inside({
sh "dockerfile_lint -p -f ${dockerfile}"
})
}
35 changes: 35 additions & 0 deletions vars/shellCheck.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* shellcheck for jenkins-pipelines https://github.com/koalaman/shellcheck
*
*/
package com.cloudogu.ces.cesbuildlib

/**
* run shellcheck with a custom fileList
* sample input "test1.sh", "test2.sh"
*
*/
def call(fileList) {
executeWithDocker(fileList)
}

/**
* run shellcheck on every .sh file inside the project folder
* note: it ignores ./ecosystem folder for usage with ecosystem instances
*
*/
def call() {
def fileList = sh (script: 'find . -path ./ecosystem -prune -o -type f -regex .*\\.sh -print', returnStdout: true)
fileList='"' + fileList.trim().replaceAll('\n','" "') + '"'
executeWithDocker(fileList)
}

/*
* run the alpine based shellcheck image
* note: we encountered some problems while using the minified docker image
*/
private def executeWithDocker(fileList){
docker.image('koalaman/shellcheck-alpine:stable').inside(){
sh "/bin/shellcheck ${fileList}"
}
}

0 comments on commit 788460c

Please sign in to comment.