Merge branch '83-docker-hub' into 'dev'
Resolve "Образ для docker hub" Closes #83 See merge request romanov73/ng-tracker!46
This commit is contained in:
commit
d26ab93629
@ -1,16 +1,11 @@
|
|||||||
image: ubuntu:18.04
|
image: romanov73/is:ng-tracker-container
|
||||||
|
|
||||||
cache:
|
|
||||||
key: "$CI_PROJECT_ID"
|
|
||||||
paths:
|
|
||||||
- .gradle/
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
- service postgresql stop
|
||||||
- apt-get install openjdk-8-jdk git -y
|
- service postgresql start
|
||||||
- eval $(ssh-agent -s)
|
- eval $(ssh-agent -s)
|
||||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
@ -20,12 +15,14 @@ before_script:
|
|||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
script: ./gradlew assemble
|
script: ./gradlew assemble
|
||||||
cache:
|
|
||||||
key: "$CI_PROJECT_ID"
|
checkRun:
|
||||||
policy: push
|
stage: test
|
||||||
paths:
|
script: ./gradlew bootRun -Dng-tracker.check-run=true
|
||||||
- build
|
|
||||||
- .gradle
|
checkStyle:
|
||||||
|
stage: test
|
||||||
|
script: ./gradlew check
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
@ -33,12 +30,6 @@ deploy:
|
|||||||
- sh deploy/gdccloud/deploy.sh
|
- sh deploy/gdccloud/deploy.sh
|
||||||
only:
|
only:
|
||||||
- dev
|
- dev
|
||||||
cache:
|
|
||||||
key: "$CI_PROJECT_ID"
|
|
||||||
policy: pull
|
|
||||||
paths:
|
|
||||||
- build
|
|
||||||
- .gradle
|
|
||||||
environment:
|
environment:
|
||||||
name: staging
|
name: staging
|
||||||
url: http://193.110.3.124:8080
|
url: http://193.110.3.124:8080
|
||||||
|
@ -30,6 +30,10 @@ bootRun.dependsOn checkstyleMain
|
|||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
|
bootRun {
|
||||||
|
systemProperties = System.properties
|
||||||
|
}
|
||||||
|
|
||||||
checkstyle {
|
checkstyle {
|
||||||
|
|
||||||
project.ext.checkstyleVersion = '8.8'
|
project.ext.checkstyleVersion = '8.8'
|
||||||
|
@ -2,13 +2,30 @@ package ru.ulstu;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
|
import ru.ulstu.configuration.ApplicationProperties;
|
||||||
import ru.ulstu.core.repository.JpaDetachableRepositoryImpl;
|
import ru.ulstu.core.repository.JpaDetachableRepositoryImpl;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@EnableJpaRepositories(repositoryBaseClass = JpaDetachableRepositoryImpl.class)
|
@EnableJpaRepositories(repositoryBaseClass = JpaDetachableRepositoryImpl.class)
|
||||||
public class NgTrackerApplication {
|
public class NgTrackerApplication {
|
||||||
|
private final ApplicationProperties applicationProperties;
|
||||||
|
|
||||||
|
public NgTrackerApplication(ApplicationProperties applicationProperties) {
|
||||||
|
this.applicationProperties = applicationProperties;
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(NgTrackerApplication.class, args);
|
SpringApplication.run(NgTrackerApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventListener(ApplicationReadyEvent.class)
|
||||||
|
public void doSomethingAfterStartup() {
|
||||||
|
System.out.println("hello world, I have just started up");
|
||||||
|
if (applicationProperties.isCheckRun()) {
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,12 +11,16 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
public class ApplicationProperties {
|
public class ApplicationProperties {
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String baseUrl;
|
private String baseUrl;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String undeadUserLogin;
|
private String undeadUserLogin;
|
||||||
|
|
||||||
private boolean devMode;
|
private boolean devMode;
|
||||||
|
|
||||||
private boolean useHttps;
|
private boolean useHttps;
|
||||||
|
|
||||||
|
private boolean checkRun;
|
||||||
|
|
||||||
public boolean isUseHttps() {
|
public boolean isUseHttps() {
|
||||||
return useHttps;
|
return useHttps;
|
||||||
}
|
}
|
||||||
@ -48,4 +52,12 @@ public class ApplicationProperties {
|
|||||||
public void setDevMode(boolean devMode) {
|
public void setDevMode(boolean devMode) {
|
||||||
this.devMode = devMode;
|
this.devMode = devMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCheckRun() {
|
||||||
|
return checkRun;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckRun(boolean checkRun) {
|
||||||
|
this.checkRun = checkRun;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,4 +35,5 @@ liquibase.change-log=classpath:db/changelog-master.xml
|
|||||||
ng-tracker.base-url=http://127.0.0.1:8080
|
ng-tracker.base-url=http://127.0.0.1:8080
|
||||||
ng-tracker.undead-user-login=admin
|
ng-tracker.undead-user-login=admin
|
||||||
ng-tracker.dev-mode=true
|
ng-tracker.dev-mode=true
|
||||||
ng-tracker.use-https=false
|
ng-tracker.use-https=false
|
||||||
|
ng-tracker.check-run=false
|
Loading…
Reference in New Issue
Block a user