Skip to content

Commit

Permalink
Add travis CI configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mbouchenoire committed Jun 13, 2020
1 parent 0c72387 commit bc44314
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 5 deletions.
49 changes: 49 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
language: java
jdk: openjdk11

env:
- NODE_VERSION=12
- SPRING_OUTPUT_ANSI_ENABLED=ALWAYS

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

before_install:
- nvm install $NODE_VERSION

before_script:
- npm install

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/build/
- $HOME/node_modules/
- $HOME/out/

stages:
- build
- test
- publish

jobs:
include:
- stage: build
script:
- ./gradlew -Pprod clean bootJar
- stage: test
script:
- ./gradlew test integrationTest
- npm test
- stage: publish
if: type IN (tag)
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- ./gradlew jib -Djib.to.image=registry.hub.docker.com/mbouchenoire/lowfer:${TRAVIS_BRANCH}
- stage: publish
if: (NOT (type IN (tag, pull_request)))
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- ./gradlew jib -Djib.to.image=registry.hub.docker.com/mbouchenoire/lowfer:${TRAVIS_BRANCH}-snapshot
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ if (OperatingSystem.current().isWindows()) {
defaultTasks "bootRun"

group = "org.lowfer"
version = "0.1.0-SNAPSHOT"
version = "0.1.0-snapshot"

description = ""

springBoot {
mainClassName = "org.lowfer.LowferApp"
mainClassName = "org.lowfer.Lowfer"
}

test {
Expand Down
7 changes: 5 additions & 2 deletions gradle/docker.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ jib {
image = "adoptopenjdk:11-jre-hotspot"
}
to {
image = "lowfer:latest"
image = "mbouchenoire/lowfer"
project.afterEvaluate {
tags = [project.version.toString()]
}
}
container {
entrypoint = ["sh", "-c", "chmod +x /entrypoint.sh && sync && /entrypoint.sh"]
ports = ["8080"]
environment = [
SPRING_OUTPUT_ANSI_ENABLED: "ALWAYS",
JHIPSTER_SLEEP: "0"
JHIPSTER_SLEEP : "0"
]
useCurrentTimestamp = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Repository;

import java.io.File;
import java.util.*;
import java.util.stream.Collectors;

//@Repository
@Repository
@ConditionalOnProperty(prefix = "application.architectures.", value = "directory")
@ConditionalOnMissingBean(ArchitectureGitRepository.class)
public class ArchitectureDirectoryRepository implements ArchitectureRepository {
Expand Down

0 comments on commit bc44314

Please sign in to comment.