Skip to content

Commit

Permalink
Make quarkus dependencies management more robust.
Browse files Browse the repository at this point in the history
  • Loading branch information
doru1004 authored and astefanutti committed Sep 24, 2021
1 parent 05856a6 commit bb86ac5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
15 changes: 12 additions & 3 deletions pkg/cmd/util_containerization.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,22 @@ func createAndBuildIntegrationImage(ctx context.Context, containerRegistry strin
}

// Copy quarkus files in maven subdirectory
updateQuarkusDirectory()
err = updateQuarkusDirectory()
if err != nil {
return err
}

// Copy app files in maven subdirectory
updateAppDirectory()
err = updateAppDirectory()
if err != nil {
return err
}

// Copy lib files in maven subdirectory
updateLibDirectory()
err = updateLibDirectory()
if err != nil {
return err
}

// Get integration run command to be run inside the container. This means the command
// has to be created with the paths which will be valid inside the container.
Expand Down
1 change: 0 additions & 1 deletion pkg/util/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func CreateIntegrationImageDockerFile(integrationRunCmd *exec.Cmd, startsFromLoc
dockerFile = append(dockerFile, COPY(util.CustomQuarkusDirectoryName, util.ContainerQuarkusDirectoryName))
dockerFile = append(dockerFile, COPY(util.CustomLibDirectoryName, util.ContainerLibDirectoryName))
dockerFile = append(dockerFile, COPY(util.CustomAppDirectoryName, util.ContainerAppDirectoryName))

}

// All Env variables the command requires need to be set in the container.
Expand Down
23 changes: 11 additions & 12 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,18 +647,17 @@ func CopyQuarkusAppFiles(localDependenciesDirectory string, localQuarkusDir stri
return err
}

source := path.Join(localDependenciesDirectory, "quarkus-application.dat")
destination := path.Join(localQuarkusDir, "quarkus-application.dat")
_, err = CopyFile(source, destination)
if err != nil {
return err
}

source = path.Join(localDependenciesDirectory, "generated-bytecode.jar")
destination = path.Join(localQuarkusDir, "generated-bytecode.jar")
_, err = CopyFile(source, destination)
if err != nil {
return err
// Transfer all files with a .dat extension and all files with a *-bytecode.jar suffix.
files, err := getRegularFileNamesInDir(localDependenciesDirectory)
for _, file := range files {
if strings.HasSuffix(file, ".dat") || strings.HasSuffix(file, "-bytecode.jar") {
source := path.Join(localDependenciesDirectory, file)
destination := path.Join(localQuarkusDir, file)
_, err = CopyFile(source, destination)
if err != nil {
return err
}
}
}

return nil
Expand Down

0 comments on commit bb86ac5

Please sign in to comment.