Commit e84dd7ce authored by Josue Martinez Villacorta's avatar Josue Martinez Villacorta
Browse files

ENA-2989 Webin portal, update to use gitlab repo.

parent 507e749f
......@@ -11,7 +11,6 @@ buildscript {
repositories {
mavenLocal()
maven { url "http://ena-dev:8081/artifactory/all" }
maven { url "https://plugins.gradle.org/m2/" }
}
}
......@@ -20,17 +19,21 @@ enum Environment{
localdev, localtest, dev , test , prod
}
ext.version_base = '0.4.2'
ext.environment = project.hasProperty('env') ? env : Environment.prod.toString();
ext.version_base = '0.4.2_test'
ext.environment = project.hasProperty('env') ? env : Environment.dev.toString();
version = version_base + "-$ext.environment"
group = 'uk.ac.ebi.ena.webin-portal'
ext.sshKeyFile = file(hasProperty('sshKeyFile') ? sshKeyFile : "${System.properties['user.home']}/.ssh/id_rsa")
project.ext.properties.gitlab_private_token = gitlab_private_token
ext.envAngularBuildScriptMap = [
'test' : 'buildTest',
'dev' : 'buildDev',
'prod' : 'buildProd',
'default': 'build'
]
printSetup()
......@@ -52,9 +55,9 @@ sourceCompatibility = 1.8
sourceSets.main.resources.includes = [ "**/*.*" ]
repositories {
mavenLocal()
maven { url "http://ena-dev:8081/artifactory/all" }
mavenCentral()
mavenLocal()
maven { url "https://gitlab.ebi.ac.uk/api/v4/groups/enasequence/-/packages/maven" }
mavenCentral()
}
dependencies {
......@@ -75,35 +78,23 @@ processResources {
}
}
jar.manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version,
'Source-Compatibility': project.sourceCompatibility
)
jar {
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Source-Compatibility': project.sourceCompatibility)
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task buildClientWatch(type: NpmTask, dependsOn: 'npmInstall'){
group = 'application'
description = "Build and watches the client side assets for rebuilding"
args = ['run','buildWatch']
}
task buildClient(type:NpmTask, dependsOn:'npmInstall'){
println 'buildClient script:' + getAngularBuildScript()
group = 'build'
description = "Compile client side folder for production"
args = ['run', getAngularBuildScript()]
}
remotes {
dev {
host = 'ves-ebi-5b.ebi.ac.uk'
......@@ -131,32 +122,51 @@ remotes {
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
}
}
repositories {
maven {
credentials {
username artifactoryUsername
password artifactoryPassword
// Project specific maven repository in Gitlab.
url "https://gitlab.ebi.ac.uk/api/v4/projects/977/packages/maven"
// Developer token in Gitlab.
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = project.ext.properties.gitlab_private_token
}
authentication {
header( HttpHeaderAuthentication )
}
url "http://ena-dev:8081/artifactory/libs-release-local"
}
}
}
jar.manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version,
'Source-Compatibility': project.sourceCompatibility
)
wrapper{
gradleVersion = '5.2.1'
}
task buildClientWatch(type: NpmTask, dependsOn: 'npmInstall'){
group = 'application'
description = "Build and watches the client side assets for rebuilding"
args = ['run','buildWatch']
}
task buildClient(type:NpmTask, dependsOn:'npmInstall'){
println 'buildClient script:' + getAngularBuildScript()
group = 'build'
description = "Compile client side folder for production"
args = ['run', getAngularBuildScript()]
}
def getEnvRemotes() {
def hosts = [] ;
......@@ -179,13 +189,15 @@ def getAngularBuildScript(){
}
task deploy << {
ssh.run {
println("execute" + "~/ena/generic-deploy.sh $project.name $version $environment $serverPort $serverContextPath")
for (remote in getEnvRemotes()){
println("Deploying into: " + remote)
session(remote) {
execute "~/ena/generic-deploy.sh $project.name $version $environment $serverPort $serverContextPath"
task deploy() {
doLast {
ssh.run {
println("execute" + "~/ena/generic-deploy.sh $project.name $version $environment $serverPort $serverContextPath")
for (remote in getEnvRemotes()) {
println("Deploying into: " + remote)
session(remote) {
execute "~/ena/generic-deploy.sh $project.name $version $environment $serverPort $serverContextPath"
}
}
}
}
......
:PROMPT
SET /P AREYOUSURE=Are you sure spring boot jars will be deployed in production (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
call gradlew -Penv=dev clean deploy
call gradlew -Penv=test clean deploy
call gradlew -Penv=prod clean deploy
call gradlew clean
:END
\ No newline at end of file
SET /P AREYOUSURE=Are you sure spring boot jars will be deployed in production (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
call gradlew -Penv=dev clean deploy
call gradlew -Penv=test clean deploy
call gradlew -Penv=prod clean deploy
call gradlew clean
:END
\ No newline at end of file
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
......@@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
......
......@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment