michaelsembwever commented on code in PR #1996:
URL: https://github.com/apache/cassandra/pull/1996#discussion_r3388592020
##########
build.xml:
##########
@@ -2305,30 +1998,83 @@
file="${build.dir}/${final.name}-javadoc.jar"
classifier="javadoc"/>
- <!-- the cassandra-sstableloader jar -->
- <deploy pomFile="${build.dir}/${final.name}-sstableloader.pom"
- file="${build.dir}/tools/lib/sstableloader.jar"/>
- <deploy pomFile="${build.dir}/${final.name}-sstableloader.pom"
- file="${build.dir}/${final.name}-sstableloader-sources.jar"
- classifier="sources"/>
- <deploy pomFile="${build.dir}/${final.name}-sstableloader.pom"
- file="${build.dir}/${final.name}-sstableloader-javadoc.jar"
- classifier="javadoc"/>
-
<!-- the distribution -->
- <sign-dist file="${build.dir}/${final.name}-bin.tar.gz" />
+ <sign-dist file="${tarball.location}" />
<sign-dist file="${build.dir}/${final.name}-src.tar.gz" />
</target>
- <import file="${build.helpers.dir}/build-resolver.xml"/>
- <import file="${build.helpers.dir}/build-rat.xml"/>
- <import file="${build.helpers.dir}/build-owasp.xml"/>
- <import file="${build.helpers.dir}/build-git.xml"/>
- <import file="${build.helpers.dir}/build-checkstyle.xml"/>
- <import file="${build.helpers.dir}/build-cqlsh.xml"/>
- <import file="${build.helpers.dir}/build-bench.xml"/>
- <import file="${build.helpers.dir}/build-sonar.xml"/>
- <import file="${build.helpers.dir}/build-accord.xml" />
- <import file="${basedir}/tools/sstableloader/build.xml"/>
+ <target name="docker-build"
+ description="Builds a local cassandra-test docker image">
+
+ <!-- check docker exists -->
+ <fail message="docker not found">
+ <condition>
+ <not>
+ <available file="docker" filepath="${env.PATH}"/>
+ </not>
+ </condition>
+ </fail>
+
+ <antcall target="artifacts">
+ <param name="no-javadoc" value="true"/>
+ <param name="ant.gen-doc.skip" value="true"/>
+ </antcall>
+
+ <!-- copy docker templates to build directory and set permissions -->
+ <copy file=".build/docker/Dockerfile" tofile="${build.dir}/Dockerfile"/>
+ <copy file=".build/docker/docker-entrypoint.sh"
tofile="${build.dir}/docker-entrypoint.sh"/>
+ <chmod file="${build.dir}/docker-entrypoint.sh" perm="777"/>
+
+ <!-- build docker image -->
+ <exec executable="docker" failonerror="true">
+ <arg value="build"/>
+ <arg value="-t"/>
+ <arg value="apache/cassandra-test"/>
+ <arg value="--build-arg"/>
+ <arg value="CASSANDRA_TARBALL=${final.name}-bin.tar.gz"/>
+ <arg value="${build.dir}"/>
+ </exec>
+
+ <!-- remove docker templates -->
+ <delete file="${build.dir}/Dockerfile"/>
+ <delete file="${build.dir}/docker-entrypoint.sh"/>
+
+ <echo>cassandra-test image built, start it with 'ant docker-start'.</echo>
+ </target>
+
+ <target name="docker-start"
+ description="Starts a local cassandra-test docker container">
+
+ <!-- check docker exists -->
+ <fail message="docker not found">
+ <condition>
+ <not>
+ <available file="docker" filepath="${env.PATH}"/>
+ </not>
+ </condition>
+ </fail>
+
+ <exec executable=".build/docker/start.sh" failonerror="true"/>
+ </target>
+
+ <target name="docker-stop"
+ description="Stops a local cassandra-test docker container">
+
+ <!-- check docker exists -->
+ <fail message="docker not found">
+ <condition>
+ <not>
+ <available file="docker" filepath="${env.PATH}"/>
+ </not>
+ </condition>
+ </fail>
+
+ <exec executable=".build/docker/stop.sh" failonerror="true"/>
+ </target>
+
Review Comment:
i'm not comfortable with introducing these docker commands into the ant
build system.
Today, all docker functionality is layered on top of the ant build. This
then makes docker a dependency of ant and so creates a cyclic dependency
between docker and ant.
Suggested approach is to match the existing practice: using
`.build/docker/start.sh` and `.build/docker/stop.sh` directly.
If you look into the scripts in `.build/docker/` you can see there's
existing functionality for building your docker image (and it would silently
included as part of the start.sh and stop.sh scripts).
and Dockerfile and docker-entrypoint.sh files need more descriptive names,
given there's other files in that directory.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]