-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor assembly jar defs in tarball gen
- Loading branch information
Showing
5 changed files
with
100 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 | ||
# (the "License"). You may not use this work except in compliance with the License, which is | ||
# available at www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
# either express or implied, as more fully set forth in the License. | ||
# | ||
# See the NOTICE file distributed with this work for information regarding copyright ownership. | ||
# | ||
|
||
client: | ||
generatedJarPath: assembly/client/target/alluxio-assembly-client-${VERSION}-jar-with-dependencies.jar | ||
tarballJarPath: assembly/alluxio-client-${VERSION}.jar | ||
fileReplacements: | ||
libexec/alluxio-config.sh: | ||
assembly/client/target/alluxio-assembly-client-${VERSION}-jar-with-dependencies.jar: assembly/alluxio-client-${VERSION}.jar | ||
server: | ||
generatedJarPath: assembly/server/target/alluxio-assembly-server-${VERSION}-jar-with-dependencies.jar | ||
tarballJarPath: assembly/alluxio-server-${VERSION}.jar | ||
fileReplacements: | ||
libexec/alluxio-config.sh: | ||
assembly/server/target/alluxio-assembly-server-${VERSION}-jar-with-dependencies.jar: assembly/alluxio-server-${VERSION}.jar | ||
fuseBundled: | ||
generatedJarPath: dora/integration/fuse/target/alluxio-integration-fuse-${VERSION}-jar-with-dependencies.jar | ||
tarballJarPath: dora/integration/fuse/alluxio-fuse-${VERSION}.jar | ||
fileReplacements: | ||
dora/integration/fuse/bin/alluxio-fuse: | ||
target/alluxio-integration-fuse-${VERSION}-jar-with-dependencies.jar: alluxio-fuse-${VERSION}.jar | ||
fuseStandalone: | ||
generatedJarPath: dora/integration/fuse/target/alluxio-integration-fuse-${VERSION}-jar-with-dependencies.jar | ||
tarballJarPath: lib/alluxio-fuse-${VERSION}.jar | ||
fileReplacements: | ||
dora/integration/fuse/bin/alluxio-fuse: | ||
target/alluxio-integration-fuse-${VERSION}-jar-with-dependencies.jar: ../../../lib/alluxio-fuse-${VERSION}.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 | ||
* (the "License"). You may not use this work except in compliance with the License, which is | ||
* available at www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied, as more fully set forth in the License. | ||
* | ||
* See the NOTICE file distributed with this work for information regarding copyright ownership. | ||
*/ | ||
|
||
package cmd | ||
|
||
import ( | ||
"io/ioutil" | ||
"log" | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/palantir/stacktrace" | ||
"gopkg.in/yaml.v3" | ||
) | ||
|
||
type AssemblyJar struct { | ||
GeneratedJarPath string `yaml:"generatedJarPath"` // relative path of generated jar, before formatting with alluxio version string | ||
TarballJarPath string `yaml:"tarballJarPath"` // relative path of copied jar into the tarball, before formatting with alluxio version string | ||
FileReplacements map[string]map[string]string `yaml:"fileReplacements"` // location of file to execute replacement -> find -> replace | ||
} | ||
|
||
type AssemblyJars map[string]*AssemblyJar | ||
|
||
func loadAssemblyJars(assemblyYml string) (AssemblyJars, error) { | ||
wd, err := os.Getwd() | ||
if err != nil { | ||
return nil, stacktrace.Propagate(err, "error getting current working directory") | ||
} | ||
assemblyYmlPath := filepath.Join(wd, assemblyYml) | ||
log.Printf("Reading assembly jars from %v", assemblyYmlPath) | ||
content, err := ioutil.ReadFile(assemblyYmlPath) | ||
if err != nil { | ||
return nil, stacktrace.Propagate(err, "error reading file at %v", assemblyYmlPath) | ||
} | ||
var assemblyJars AssemblyJars | ||
if err := yaml.Unmarshal(content, &assemblyJars); err != nil { | ||
return nil, stacktrace.Propagate(err, "error unmarshalling assembly jars from:\n%v", string(content)) | ||
} | ||
return assemblyJars, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters