forked from SteamWar/SteamWar
Fix CI
This commit is contained in:
+17
-7
@@ -17,6 +17,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.codehaus.plexus.util.Os
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
import java.util.Properties
|
import java.util.Properties
|
||||||
|
|
||||||
@@ -49,6 +50,9 @@ plugins {
|
|||||||
group = "de.steamwar"
|
group = "de.steamwar"
|
||||||
version = ""
|
version = ""
|
||||||
|
|
||||||
|
|
||||||
|
private val isInCi by lazy { Os.isFamily(Os.FAMILY_UNIX) && ProcessBuilder("hostname").start().inputStream.bufferedReader().readText().startsWith("steamwar.de") }
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -74,14 +78,20 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
maven {
|
if (isInCi) {
|
||||||
url = URI("https://steamwar.de/maven/")
|
maven {
|
||||||
credentials {
|
url = URI("file:///var/www/html/maven/")
|
||||||
val swProps = Properties()
|
}
|
||||||
swProps.load(rootProject.file("steamwar.properties").inputStream())
|
} else {
|
||||||
|
maven {
|
||||||
|
url = URI("https://steamwar.de/maven/")
|
||||||
|
credentials {
|
||||||
|
val swProps = Properties()
|
||||||
|
swProps.load(rootProject.file("steamwar.properties").inputStream())
|
||||||
|
|
||||||
username = swProps.getProperty("maven.username")
|
username = swProps.getProperty("maven.username")
|
||||||
password = swProps.getProperty("maven.password")
|
password = swProps.getProperty("maven.password")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user