代码拉取完成,页面将自动刷新
同步操作将从 dafeiyu/jsnes 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
buildscript {
repositories {
maven { url("https://maven.aliyun.com/repository/public") }
maven { url("https://maven.aliyun.com/repository/spring") }
maven { url("https://maven.aliyun.com/repository/mapr-public") }
maven { url("https://maven.aliyun.com/repository/spring-plugin") }
maven { url("https://maven.aliyun.com/repository/gradle-plugin") }
maven { url("https://maven.aliyun.com/repository/google") }
maven { url("https://maven.aliyun.com/repository/jcenter") }
}
}
plugins {
id "de.undercouch.download" version "4.1.1"
}
def mainVersion = "1.0.0"
Map<String, String> envMap = new HashMap<>(System.getenv())
def imageRepository = envMap.getOrDefault("IMAGE_REPOSITORY ", "wangz2019/jsnes")
String imageWithTag = "${imageRepository}:${mainVersion}"
File runtimeDockerDirectory = project.file("${project.buildDir}/runtime/docker")
task buildDockerImage() {
doFirst {
runtimeDockerDirectory.mkdirs()
runtimeDockerDirectory.delete()
copy {
from project.file("docker")
into runtimeDockerDirectory
}
copy {
from project.file("lib")
into "${runtimeDockerDirectory}/lib"
}
copy {
from project.file("src")
into "${runtimeDockerDirectory}/src"
}
copy {
from project.file("roms")
into "${runtimeDockerDirectory}/roms"
}
}
doLast {
exec {
commandLine(
"docker", "build",
"--rm",
"-f", project.file("${runtimeDockerDirectory.getAbsolutePath()}/Dockerfile"),
"-t", imageWithTag,
runtimeDockerDirectory,
)
}
}
}
task pushDockerImage() {
doLast {
exec {
commandLine(
"docker", "buildx", "build",
"--platform", "linux/amd64,linux/arm64,linux/arm/v7",
"--rm",
"-f", project.file("${runtimeDockerDirectory.getAbsolutePath()}/Dockerfile"),
"-t", imageWithTag,
"--push",
runtimeDockerDirectory,
)
}
}
dependsOn(buildDockerImage)
}
def containerName = "jsnes"
def port = 8081
task runDockerContainer(type: Exec) {
doFirst {
println("running command: ${String.join(" ", getCommandLine())}")
}
executable("docker")
args(
"run", "--rm",
"-p", "${port}:80",
"--name", containerName,
"-d", imageWithTag,
)
doLast {
println("visit http://localhost:${port}")
}
}
task stopDockerContainer(type: Exec) {
executable("docker")
args(
"stop", containerName
)
}
apply from: project.file("docs.nginx.gradle")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。