You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/08/24 05:23:55 UTC

[GitHub] [camel-k] tadayosi commented on a diff in pull request #3376: [WIP] chore(build): Use Camel K runtime Maven structural logging module

tadayosi commented on code in PR #3376:
URL: https://github.com/apache/camel-k/pull/3376#discussion_r953357963


##########
script/maven_overlay.sh:
##########
@@ -15,14 +15,94 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+location=$(dirname $0)
+rootdir=$(realpath ${location}/../)
+
+if [ "$#" -lt 2 ]; then
+  echo "usage: $0 <output directory> <Camel K runtime version> [<staging repository>] [<local Camel K runtime project directory>]"

Review Comment:
   it's a small issue but the usage message doesn't match the actual code. Here `<output directory>` comes first but actually it should be `$2` arg.
   
   Maybe I guess the usage message is the intended one and the code `output_dir=$2` is wrong?  Is it really meant to be :
   ```
   output_dir=$1
   runtime_version=$2
   ```
   ?



##########
script/maven_overlay.sh:
##########
@@ -15,14 +15,94 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+location=$(dirname $0)
+rootdir=$(realpath ${location}/../)
+
+if [ "$#" -lt 2 ]; then
+  echo "usage: $0 <output directory> <Camel K runtime version> [<staging repository>] [<local Camel K runtime project directory>]"
+  exit 1
+fi
+
 options=""
 if [ "$CI" = "true" ]; then
   options="--batch-mode"
 fi
 
-mvn -q $options dependency:get -Dartifact=ch.qos.logback:logback-core:1.2.3 -Ddest=$1
-mvn -q $options dependency:get -Dartifact=ch.qos.logback:logback-classic:1.2.3 -Ddest=$1
-mvn -q $options dependency:get -Dartifact=net.logstash.logback:logstash-logback-encoder:4.11 -Ddest=$1
-mvn -q $options dependency:get -Dartifact=com.fasterxml.jackson.core:jackson-annotations:2.9.10 -Ddest=$1
-mvn -q $options dependency:get -Dartifact=com.fasterxml.jackson.core:jackson-core:2.9.10 -Ddest=$1
-mvn -q $options dependency:get -Dartifact=com.fasterxml.jackson.core:jackson-databind:2.9.10.8 -Ddest=$1
+runtime_version=$1
+output_dir=$2
+staging_repo=${3:-}
+local_runtime_dir=${4:-}
+
+if [ -n "$staging_repo" ]; then
+    if  [[ $staging_repo == http:* ]] || [[ $staging_repo == https:* ]]; then
+        echo "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" \

Review Comment:
   I'd use bash heredocument to avoid `\` at the end of lines but maybe it's a matter of taste.
   ```
   cat <<EOF > ${rootdir}/settings.xml
   ...
   EOF
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org