Skip to content

Commit

Permalink
add start shell
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Sep 28, 2018
1 parent b0256c9 commit 4c50f07
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ target/
*.eclipse.*
*.iml
plugins/
lib/
40 changes: 40 additions & 0 deletions bin/submit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
#

set -e

export SQL_HOME="$(cd "`dirname "$0"`"/..; pwd)"

# Find the java binary
if [ -n "${JAVA_HOME}" ]; then
JAVA_RUN="${JAVA_HOME}/bin/java"
else
if [ `command -v java` ]; then
JAVA_RUN="java"
else
echo "JAVA_HOME is not set" >&2
exit 1
fi
fi

JAR_DIR=$SQL_HOME/lib/*
CLASS_NAME=com.dtstack.flink.sql.launcher.LauncherMain

echo "sql submit ..."
nohup $JAVA_RUN -cp $JAR_DIR $CLASS_NAME $@ &
12 changes: 12 additions & 0 deletions launcher/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
target
.idea/
/.idea/*
target/
.class
.project
.classpath
*.eclipse.*
*.iml
plugins/
lib/
dependency-reduced-pom.xml
85 changes: 85 additions & 0 deletions launcher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,89 @@
</dependency>
</dependencies>

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>

<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" />
<!-- The service transformer is needed to merge META-INF/services files -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>reference.conf</resource>
</transformer>

<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>core-default.xml</resource>
</transformer>

<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>core-site.xml</resource>
</transformer>

<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>yarn-default.xml</resource>
</transformer>

<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>mapred-default.xml</resource>
</transformer>

<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
<resource>mapred-site.xml</resource>
</transformer>
</transformers>

<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${basedir}/../lib/">
<fileset dir="target/">
<include name="${project.name}-${project.version}.jar" />
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 4c50f07

Please sign in to comment.