Skip to content

Commit

Permalink
Merge pull request #11 from JavatarPro/docker-only
Browse files Browse the repository at this point in the history
Docker only
  • Loading branch information
borys-zora authored Apr 12, 2021
2 parents e058f3b + 24c4ba0 commit 5ad0661
Show file tree
Hide file tree
Showing 66 changed files with 1,298 additions and 315 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# declarative-pipeline #
# javatar declarative pipeline

This is shared library for jenkins CD declarative pipeline created by [Javatar LLC](https://javatar.pro/)
This is [jenkins shared library](https://jenkins.io/doc/book/pipeline/shared-libraries/) created by [Javatar](https://javatar.pro/)

### Documentation

Out documentation is in confluence follow this [link](https://javatar.atlassian.net/wiki/spaces/JDP/overview)
Our [documentation is in confluence](https://javatar.atlassian.net/wiki/spaces/JDP/overview)

### What is this repository for? ###

* This is shared library for jenkins CD pipeline
* Jenkinsfile example [continuous-delivery repo](https://github.com/JavatarPro/declarative-pipeline)
* Setup CI/CD for micro-sevices with a help of jenkins & this library
* java
* golang
* nodejs
* Setup CI/CD for UI repos based on docker or S3 artifacts
* angular
* react
* viewjs

### How do I get set up? ###

* You can use import @Library('declarative-pipeline') into Jenkinsfile
* All configuration should be in Jenkinsfile
* All code files must be groovy, Jenkinsfile's restriction
* All jobs (except development/experimental) should use tag version
* Jenkinsfile example [continuous-delivery repo](https://github.com/JavatarPro/declarative-pipeline)

### Contribution guidelines ###

Expand All @@ -27,13 +34,6 @@ Out documentation is in confluence follow this [link](https://javatar.atlassian.

* [borys-zora](mailto:[email protected]), [spetrychenko](mailto:[email protected])

### Useful links ###

* [pipeline shared library](https://jenkins.io/doc/book/pipeline/shared-libraries/)

### Job examples ###


### RELEASE NOTES ###

* 1.2
Expand Down
6 changes: 4 additions & 2 deletions src/command.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pipeline:
command:
commands:
- name: cmd-shell
class: pro.javatar.pipeline.command.ShellCommand
class: pro.javatar.pipeline.command.ShellCommand
-

65 changes: 65 additions & 0 deletions src/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
integrations:
- name: vcs-target-repo
repoName: ${vcsRepo}
owner: ${vcsOwner}
domain: ${vcsDomain}:${vcsPort}
# ssh, https
protocol: ${vscProtocol}
# gitlab, github, bitbucket
type: ${vcsType}
# TODO could be used in this way, just to specify all in ${vcsUrl}
url: ${vscProtocol}://git@${vcsDomain}:${vcsPort}/${vcsOwner}/${vcsRepo}.git
credentialsId: javatar-jenkins-gitlab-ssh
revisionControl: git
enabled: false
- name: docker-registry-dev
description: docker registry for temporary artifacts (small retantion policy)
url: docker-dev.your-domain.com
credentialsId: docker-registry-dev-cred
enabled: false
labels:
- docker-registry
- name: docker-registry-prod
description: docker registry for verified artifacts to be used in production
url: docker-prod.your-domain.com
credentialsId: docker-registry-prod-cred
enabled: false
labels:
- docker-registry
- name: sonar
description: tool for static code analysis
- name: java
version: JDK16
description: JDK16 - toold named in jenkins to compile with javac, supported java versions 8, 11, 13 .. 16+
# use path in case tool not available, path to binary should help
path: /path/to/java/home
labels:
- jenkinsTool
- jenkinsNodePath
enabled: false
- name: maven
version: maven_354
description: build tool for java
enabled: false
labels:
- jenkinsTool
- name: npm
description: todo
version: 7.6.3
enabled: false
- name: nodejs
version: v15.6.0
enabled: false
labels:
- jenkinsTool
- name: marathon
description: apache mesos framework - service orchestration
- name: k8s
description: kubernetes - service orchestration
enabled: false
- name: aws-s3-dev
description: S3 bucket to store dev artifacts
enabled: false
- name: aws-s3-prod
description: S3 bucket to store prod artifacts
enabled: false
28 changes: 24 additions & 4 deletions src/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# buildType will be discovered
# - pom.xml -> maven
# - build.gradle -> gradle
# - default -> command: bash command provided (e.g. mvn clean install -Dmaven.test.skip)
pipeline:
suit: service-simple
service:
name: ${serviceName}
vcs_repo: vcs-target-repo
# orchestration on of: k8s, marathon, yarn, nomad
orchestration: ${orchestration}

variables:
orchestration: k8s
# useBuildNumberForVersion: false
# buildType will be discovered
# - pom.xml -> maven
# - build.gradle -> gradle
# - default -> command: bash command provided (e.g. mvn clean install -Dmaven.test.skip)
# buildType: npm_docker

services:
- name: default
buildType: maven
orchestration: k8s
description: default service will be merged with all services that missing some required params
release:
- vcs
- docker
7 changes: 3 additions & 4 deletions src/pro/javatar/pipeline/Flow.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import pro.javatar.pipeline.jenkins.api.JenkinsDslService
import pro.javatar.pipeline.stage.StageAware;
import pro.javatar.pipeline.util.Logger

import static java.lang.String.format;
import static java.lang.String.format

/**
* @author Borys Zora
Expand Down Expand Up @@ -71,8 +71,7 @@ class Flow implements Serializable {
jenkinsDslService.executeStage(stage);
}

List<StageAware> getStages() {
return new ArrayList<StageAware>(this.stages);
List<String> getStageNames() {
stages.collect {it.getName()}
}

}
Loading

0 comments on commit 5ad0661

Please sign in to comment.