This project allows to perform downloads for different types of artifacts. The main use case for this tool is downloading plugins, themes and other files inside a Kubernetes init-container to customize applications.
-
A file via regular web call
-
One or more files from a Git repository in a specific directory
-
An Artifact from a Maven2 repository
Other artifact types are planned.
The tool expects a task name as the fist argument to perform downloads with a specific strategy.
command line parameter | environment variable | description | required |
---|---|---|---|
Task: |
|||
|
|
The file to be downloaded. |
yes |
|
|
A newline-separated list of headers used for the web call. |
no |
Task: |
|||
|
|
The URL or path to a Git repository. |
yes |
|
|
A specific branch used for the clone action. If unspecified the default branch is used. |
no |
|
|
A path to a specific subdirectory or file which will be cloned. If unspecified the whole repository will be cloned. |
no |
|
The Git username as part of the credentials. |
no |
|
|
The user password as part of the credentials. |
no |
|
Task: |
|||
|
|
A newline-separated list of Maven2 remote repositories. |
no |
|
|
The path to the local Maven2 repository. |
no |
|
|
The URL to a Maven2 mirror. |
no |
|
|
The Maven2 artifact name. |
yes |
|
The username used for the Maven mirror as part of the credentials. |
no |
|
|
The user password used for the Maven mirror as part of the credentials. |
no |
|
Parameters used for all artifact types |
|||
|
|
The target directory where the artifacts will be deployed. |
yes |
|
|
Specifies the user for deployed files. |
no |
|
|
Specifies the group for deployed files. |
no |
|
|
Specifies the mode for deployed files. |
no |
|
|
Caching artifacts is enabled if a path to the cache directory is defined. See feature description below. |
no |
Task: |
|||
|
|
The path to a JSON file which contains a list of artifacts. See example below. |
yes |
|
|
Caching artifacts is enabled if a path is defined. This setting is used for all downloads described in the JSON file. See feature description below. |
no |
Other parameters |
|||
|
Shows the help text and ignores other arguments. |
||
|
Shows the tool version and ignores other arguments. |
resolve-web
task./src/main.sh resolve-web --url "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.3/slf4j-api-2.0.3.jar"
resolve-git
task./src/main.sh resolve-git --url "https://github.com/qos-ch/slf4j.git" --branch "v_2.0.3"
resolve-maven
task## optional: resolve Maven artifacts behind a proxy
# export MAVEN_OPTS="-Dhttp.proxyHost=... -Dhttp.proxyHost=... -Dhttp.nonLocalHosts=..."
./src/main.sh resolve-maven --artifact "org.slf4j:slf4j-api:2.0.3"
resolve-using-config
task./src/main.sh resolve-using-config --json-config-file "my-file.json"
[
{
"task": "resolve-web",
"arguments": {
"url": "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.3/slf4j-api-2.0.3.jar",
"headers": [],
"target-dir": "./my-output-dir"
}
},
{
"task": "resolve-git",
"arguments": {
"url": "https://github.com/qos-ch/slf4j.git",
"branch": "v_2.0.3",
"source-path": "slf4j-api",
"target-dir": "./my-output-dir"
}
},
{
"task": "resolve-maven",
"arguments": {
"artifact": "org.slf4j:slf4j-api:2.0.3",
"target-dir": "./my-output-dir"
}
}
]
Sometimes there is the requirement to mirror artifacts to guarantee their permanent availability. Read here to learn more about the caching feature.
Copyright (c) 2022 ASERVO Software GmbH
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.