Skip to content

Commit

Permalink
W-16954625: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzxu-crm committed Oct 14, 2024
1 parent 9fb1841 commit 4accbcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
3 changes: 0 additions & 3 deletions carbonj.service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ RUN yum update -y && \
chmod +x /sbin/tini

# add java code
#COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
#COPY ${DEPENDENCY}/META-INF /app/META-INF
#COPY ${DEPENDENCY}/BOOT-INF/classes /app
COPY build/libs/carbonj.service-${VERSION}.jar /app
# add scripts
COPY ${DEPENDENCY}/entrypoint.sh ${DEPENDENCY}/onOutOfMemoryError.sh ${DEPENDENCY}/logCleanup.sh \
Expand Down
17 changes: 3 additions & 14 deletions carbonj.service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,7 @@ task unpack(type: Copy) {
into("build/dependency")
}

//docker {
// print "name of the docker image is ${dockerRepo}${project.dockerGroup}:${project.version}"
// name "${dockerRepo}${project.dockerGroup}:${project.version}"
// tag 'docker', "${dockerRepo}${project.dockerGroup}:${project.version}"
// files tasks.unpack.outputs, "src/main/docker/files"
// copySpec.into("dependency")
// buildArgs(['DEPENDENCY': "dependency", 'VERSION': "${project.version}"])
// noCache true
//}

tasks.register('dockerarm64', Exec) {
tasks.register('docker', Exec) {
def command = getDockerBuildCmd("${dockerRepo}${project.dockerGroup}:${project.version}", "${project.version}")
doFirst {
logger.lifecycle("${command.join(' ')}")
Expand All @@ -109,7 +99,7 @@ tasks.register('dockerarm64', Exec) {
static def getDockerBuildCmd(String name, version) {
def buildCommandLine = ['docker', 'buildx', 'build', '--platform', 'linux/amd64,linux/arm64', '--builder', 'buildbase', '--push']
// When build docker image on Mac, pick up the right command for either Intel chips or Mac Silicon and comment out the above command
// def buildCommandLine = ['docker', 'build', '--platform', 'linux/amd64', '--builder', 'buildbase', '--load']
// def buildCommandLine = ['docker', 'build', '--platform', 'linux/amd64', '--builder', 'buildbase', '--load']
// def buildCommandLine = ['docker', 'build', '--platform', 'linux/arm64', '--builder', 'buildbase', '--load']
buildCommandLine.addAll('--build-arg', "VERSION=${version}")
buildCommandLine.addAll('-t', name, '.')
Expand Down Expand Up @@ -160,9 +150,8 @@ task rpm(type: Rpm) {

// for release automatically push released docker and mvn image to repo
afterReleaseBuild.dependsOn publish
//publish.dependsOn dockerPush
publish.dependsOn docker
publish.dependsOn build
publish.dependsOn dockerarm64

publishing {
publications {
Expand Down

0 comments on commit 4accbcc

Please sign in to comment.