Compare commits
No commits in common. "3f19ccd5938b151a1d95db69c0565b4c892a0794" and "a5a1e956390e2040a16dbdc2dda74a8c31db6cb5" have entirely different histories.
3f19ccd593
...
a5a1e95639
2 changed files with 34 additions and 102 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
image: openjdk:11-jdk-slim
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
@ -5,13 +7,6 @@ stages:
|
||||||
- publish
|
- publish
|
||||||
- release
|
- release
|
||||||
|
|
||||||
.kotlin-job: &kotlin
|
|
||||||
image: domaindrivenarchitecture/ddadevops-kotlin
|
|
||||||
cache:
|
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
|
||||||
paths:
|
|
||||||
- .gradle/wrapper
|
|
||||||
- .gradle/caches
|
|
||||||
before_script:
|
before_script:
|
||||||
- echo "---------- Start CI ----------"
|
- echo "---------- Start CI ----------"
|
||||||
- export GRADLE_USER_HOME=`pwd`/.gradle
|
- export GRADLE_USER_HOME=`pwd`/.gradle
|
||||||
|
@ -21,18 +16,17 @@ stages:
|
||||||
- echo $CI_COMMIT_REF_NAME
|
- echo $CI_COMMIT_REF_NAME
|
||||||
- echo "----------------------------------"
|
- echo "----------------------------------"
|
||||||
|
|
||||||
.tag_only: &tag_only
|
cache:
|
||||||
rules:
|
paths:
|
||||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
- .gradle/wrapper
|
||||||
when: never
|
- .gradle/caches
|
||||||
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
|
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
<<: *kotlin
|
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- pyb build
|
- echo "---------- build stage ----------"
|
||||||
|
- ./gradlew assemble
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- build/libs/*.jar
|
- build/libs/*.jar
|
||||||
|
@ -66,7 +60,6 @@ test:
|
||||||
|
|
||||||
|
|
||||||
package:
|
package:
|
||||||
<<: *kotlin
|
|
||||||
stage: package
|
stage: package
|
||||||
script:
|
script:
|
||||||
- ./gradlew -x assemble -x test jar
|
- ./gradlew -x assemble -x test jar
|
||||||
|
@ -83,18 +76,22 @@ package:
|
||||||
|
|
||||||
|
|
||||||
publish-maven-package-to-gitlab:
|
publish-maven-package-to-gitlab:
|
||||||
<<: *kotlin
|
|
||||||
<<: *tag_only
|
|
||||||
stage: publish
|
stage: publish
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE != "push"
|
||||||
|
when: never
|
||||||
|
- if: $CI_COMMIT_TAG !~ /^release-[0-9]+[.][0-9]+([.][0-9]+)?$/
|
||||||
script:
|
script:
|
||||||
- ./gradlew -x assemble -x test publishLibraryPublicationToGitlabRepository
|
- ./gradlew -x assemble -x test publishLibraryPublicationToGitlabRepository
|
||||||
|
|
||||||
|
|
||||||
publish-maven-package-to-meissa:
|
publish-maven-package-to-meissa:
|
||||||
<<: *kotlin
|
|
||||||
<<: *tag_only
|
|
||||||
stage: publish
|
stage: publish
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE != "push"
|
||||||
|
when: never
|
||||||
|
- if: $CI_COMMIT_TAG !~ /^release-[0-9]+[.][0-9]+([.][0-9]+)?$/
|
||||||
script:
|
script:
|
||||||
- apt-get update -y
|
- apt-get update -y
|
||||||
- apt-get install -y iputils-ping ssh
|
- apt-get install -y iputils-ping ssh
|
||||||
|
@ -104,9 +101,12 @@ publish-maven-package-to-meissa:
|
||||||
|
|
||||||
|
|
||||||
release-to-gitlab:
|
release-to-gitlab:
|
||||||
<<: *tag_only
|
|
||||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
stage: release
|
stage: release
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE != "push"
|
||||||
|
when: never
|
||||||
|
- if: $CI_COMMIT_TAG =~ /^release-[0-9]+[.][0-9]+([.][0-9]+)?$/
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- 'build/libs/provs-desktop.jar'
|
- 'build/libs/provs-desktop.jar'
|
||||||
|
@ -126,11 +126,15 @@ release-to-gitlab:
|
||||||
|
|
||||||
|
|
||||||
release-to-meissa:
|
release-to-meissa:
|
||||||
<<: *kotlin
|
|
||||||
<<: *tag_only
|
|
||||||
stage: release
|
stage: release
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE != "push"
|
||||||
|
when: never
|
||||||
|
- if: $CI_COMMIT_TAG =~ /^release-[0-9]+[.][0-9]+([.][0-9]+)?$/
|
||||||
script:
|
script:
|
||||||
|
- apt-get update
|
||||||
|
- apt-get -yqq install curl
|
||||||
- ./gradlew createReleaseAndUploadAssets
|
- ./gradlew createReleaseAndUploadAssets
|
||||||
|
|
||||||
|
|
||||||
|
|
72
build.py
72
build.py
|
@ -1,72 +0,0 @@
|
||||||
from os import environ
|
|
||||||
from subprocess import run
|
|
||||||
from pybuilder.core import init, task
|
|
||||||
from ddadevops import *
|
|
||||||
|
|
||||||
default_task = "dev"
|
|
||||||
|
|
||||||
name = "provs"
|
|
||||||
PROJECT_ROOT_PATH = "."
|
|
||||||
|
|
||||||
|
|
||||||
@init
|
|
||||||
def initialize(project):
|
|
||||||
input = {
|
|
||||||
"name": name,
|
|
||||||
"module": "notused",
|
|
||||||
"stage": "notused",
|
|
||||||
"project_root_path": PROJECT_ROOT_PATH,
|
|
||||||
"build_types": [],
|
|
||||||
"mixin_types": ["RELEASE"],
|
|
||||||
"release_primary_build_file": "build.gradle",
|
|
||||||
"release_secondary_build_files": [],
|
|
||||||
}
|
|
||||||
|
|
||||||
build = ReleaseMixin(project, input)
|
|
||||||
build.initialize_build_dir()
|
|
||||||
|
|
||||||
@task
|
|
||||||
def patch(project):
|
|
||||||
linttest(project, "PATCH")
|
|
||||||
release(project)
|
|
||||||
|
|
||||||
|
|
||||||
@task
|
|
||||||
def minor(project):
|
|
||||||
linttest(project, "MINOR")
|
|
||||||
release(project)
|
|
||||||
|
|
||||||
|
|
||||||
@task
|
|
||||||
def major(project):
|
|
||||||
linttest(project, "MAJOR")
|
|
||||||
release(project)
|
|
||||||
|
|
||||||
|
|
||||||
@task
|
|
||||||
def dev(project):
|
|
||||||
linttest(project, "NONE")
|
|
||||||
|
|
||||||
|
|
||||||
@task
|
|
||||||
def prepare(project):
|
|
||||||
build = get_devops_build(project)
|
|
||||||
build.prepare_release()
|
|
||||||
|
|
||||||
|
|
||||||
@task
|
|
||||||
def tag(project):
|
|
||||||
build = get_devops_build(project)
|
|
||||||
build.tag_bump_and_push_release()
|
|
||||||
|
|
||||||
@task
|
|
||||||
def build(project):
|
|
||||||
print("---------- build stage ----------")
|
|
||||||
run("./gradlew assemble", shell=True)
|
|
||||||
|
|
||||||
def release(project):
|
|
||||||
prepare(project)
|
|
||||||
tag(project)
|
|
||||||
|
|
||||||
def linttest(project, release_type):
|
|
||||||
build(project)
|
|
Loading…
Reference in a new issue