Added BitBucket and GitLab CIs.
More code cleanup.
This commit is contained in:
parent
c65204414d
commit
64d2328618
10 changed files with 81 additions and 19 deletions
|
@ -4,7 +4,7 @@ defaults: &defaults
|
|||
environment:
|
||||
JVM_OPTS: -Xmx3200m
|
||||
TERM: dumb
|
||||
CI: true
|
||||
CI_NAME: "CircleCI"
|
||||
|
||||
defaults_gradle: &defaults_gradle
|
||||
steps:
|
||||
|
|
26
.github/workflows/gradle.yml
vendored
Normal file
26
.github/workflows/gradle.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push
|
||||
pull_request
|
||||
workflow_dispatch
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Set environment variables
|
||||
env:
|
||||
CI_NAME: "GitHub CI"
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Test with Gradle
|
||||
run: ./gradlew check
|
32
.gitlab-ci.yml
Normal file
32
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,32 @@
|
|||
image: openjdk:11-jdk-slim
|
||||
|
||||
variables:
|
||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||
CI_NAME: "GitLab CI"
|
||||
|
||||
before_script:
|
||||
- export GRADLE_USER_HOME=`pwd`/.gradle
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
|
||||
build:
|
||||
stage: build
|
||||
script: ./gradlew --build-cache assemble
|
||||
cache:
|
||||
key: "$CI_COMMIT_REF_NAME"
|
||||
policy: push
|
||||
paths:
|
||||
- build
|
||||
- .gradle
|
||||
|
||||
test:
|
||||
stage: test
|
||||
script: ./gradlew check
|
||||
cache:
|
||||
key: "$CI_COMMIT_REF_NAME"
|
||||
policy: pull
|
||||
paths:
|
||||
- build
|
||||
- .gradle
|
|
@ -3,7 +3,7 @@ dist: trusty
|
|||
|
||||
env:
|
||||
global:
|
||||
- CI=true
|
||||
- CI_NAME: "Travis CI"
|
||||
|
||||
install:
|
||||
- git fetch --unshallow --tags
|
||||
|
|
9
bitbucket-pipelines.yml
Normal file
9
bitbucket-pipelines.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
image: openjdk:11
|
||||
|
||||
pipelines:
|
||||
default:
|
||||
- step:
|
||||
caches:
|
||||
- gradle
|
||||
script:
|
||||
- bash ./gradlew check
|
|
@ -188,12 +188,12 @@ public class Mobibot extends PircBot {
|
|||
setVerbose(true);
|
||||
setAutoNickChange(true);
|
||||
setLogin(p.getProperty("login", getName()));
|
||||
setVersion(p.getProperty("weblog", ""));
|
||||
setVersion(ReleaseInfo.PROJECT + ' ' + ReleaseInfo.VERSION);
|
||||
// setMessageDelay(1000);
|
||||
setIdentity(p.getProperty("ident", ""), p.getProperty("ident-nick", ""), p.getProperty("ident-msg", ""));
|
||||
|
||||
// Set the URLs
|
||||
setWeblogUrl(getVersion());
|
||||
setWeblogUrl(p.getProperty("weblog", ""));
|
||||
setBacklogsUrl(Utils.ensureDir(p.getProperty("backlogs", weblogUrl), true));
|
||||
|
||||
// Set the pinboard authentication
|
||||
|
@ -404,7 +404,6 @@ public class Mobibot extends PircBot {
|
|||
}
|
||||
}
|
||||
}
|
||||
setVersion(ReleaseInfo.PROJECT + ' ' + ReleaseInfo.VERSION);
|
||||
identify();
|
||||
joinChannel();
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class ChannelFeed(bot: Mobibot, channel: String) : AbstractCommand(bot) {
|
|||
isPrivate: Boolean
|
||||
) {
|
||||
with(getProperty(FEED_PROP)) {
|
||||
if (!this.isNullOrBlank()) {
|
||||
if (!isNullOrBlank()) {
|
||||
Thread(FeedReader(bot, sender, this)).start()
|
||||
} else {
|
||||
bot.send(sender, "There is no feed setup for this channel.", false)
|
||||
|
|
|
@ -44,8 +44,8 @@ import java.util.List;
|
|||
|
||||
public class Info extends AbstractCommand {
|
||||
private final List<String> version = List.of(
|
||||
StringUtils.capitalize(ReleaseInfo.PROJECT) + " " + ReleaseInfo.VERSION + " ("
|
||||
+ Utils.green(ReleaseInfo.WEBSITE) + ')',
|
||||
StringUtils.capitalize(ReleaseInfo.PROJECT) + " " + ReleaseInfo.VERSION
|
||||
+ " (" + Utils.green(ReleaseInfo.WEBSITE) + ')',
|
||||
"Written by " + ReleaseInfo.AUTHOR + " (" + Utils.green(ReleaseInfo.AUTHOR_URL) + ')');
|
||||
|
||||
public Info(@NotNull final Mobibot bot) {
|
||||
|
|
|
@ -42,13 +42,10 @@ import java.util.List;
|
|||
public class Versions extends AbstractCommand {
|
||||
private final List<String> verList =
|
||||
List.of("Version: " + ReleaseInfo.VERSION + " (" + Utils.isoLocalDate(ReleaseInfo.BUILDDATE) + ')',
|
||||
"Platform: " + System.getProperty("os.name") + " (" + System.getProperty("os.version") + ", "
|
||||
+ System.getProperty("os.arch") + ", " + System.getProperty("user.country") + ')',
|
||||
"Runtime: " + System.getProperty("java.runtime.name") + " (build " + System.getProperty(
|
||||
"java.runtime.version") + ')',
|
||||
"VM: " + System.getProperty("java.vm.name") + " (build " + System.getProperty("java.vm.version")
|
||||
+ ", "
|
||||
+ System.getProperty("java.vm.info") + ')');
|
||||
"Platform: " + System.getProperty("os.name") + ' ' + System.getProperty("os.version")
|
||||
+ " (" + System.getProperty("os.arch") + ')',
|
||||
"Runtime: " + System.getProperty("java.runtime.name")
|
||||
+ ' ' + System.getProperty("java.runtime.version"));
|
||||
|
||||
public Versions(@NotNull final Mobibot bot) {
|
||||
super(bot);
|
||||
|
|
|
@ -51,10 +51,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
public class TwitterTest extends LocalProperties {
|
||||
@SuppressFBWarnings("MDM")
|
||||
private String getCi() {
|
||||
if ("true".equals(System.getenv("CIRCLECI"))) {
|
||||
return "CircleCI";
|
||||
} else if ("true".equals(System.getenv("TRAVIS"))) {
|
||||
return "Travis CI";
|
||||
final String ciName = System.getenv("CI_NAME");
|
||||
if (ciName != null) {
|
||||
return ciName;
|
||||
} else {
|
||||
try {
|
||||
return InetAddress.getLocalHost().getHostName();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue