From d7290cdc8cc95394e032d9747058a3b3d442b57f Mon Sep 17 00:00:00 2001 From: John Bampton Date: Mon, 14 Sep 2020 02:48:13 +1000 Subject: [PATCH] Add a GitHub action to lint the Markdown and YAML files. Add a basic `markdownlint` config file. Add a `yamllint` config file. Lint both Markdown and YAML files. --- .github/workflows/ci.yml | 26 ++++---- .github/workflows/lint.yml | 36 +++++++++++ .markdownlint.yml | 29 +++++++++ .travis.yml | 126 ++++++++++++++++++------------------ .yamllint | 20 ++++++ README.md | 18 +++--- modules/stuffed/README.md | 4 ++ modules/stuffed/tomcat.yaml | 30 ++++----- res/graal/README.md | 1 - 9 files changed, 190 insertions(+), 100 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .markdownlint.yml create mode 100644 .yamllint diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9f217ad7362..49a55d58594c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,19 +31,19 @@ jobs: java: [ 8, 11, 14, 15-ea ] os: [ ubuntu-latest ] include: - - os: windows-latest - java: 8 + - os: windows-latest + java: 8 name: JDK${{ matrix.java }} ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: - - name: Git Checkout - uses: actions/checkout@v2 - - name: Set up Java - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - name: Build - run: | - ant -noinput echoproperties deploy embed test-nio test-status - env: - ANT_OPTS: -Dtest.openssl.exists=false -Dtest.excludePerformance=true -Dtest.exclude=**/TestHttp2Limits.java,org/apache/catalina/connector/TestRequest.java,org/apache/coyote/http11/filters/TestChunkedInputFilter.java,org/apache/catalina/startup/TestTomcat.java,org/apache/coyote/http2/TestHttp2Timeouts.java,org/apache/catalina/core/TestAsyncContextStateChanges.java,org/apache/catalina/valves/TestStuckThreadDetectionValve.java,org/apache/coyote/http11/TestHttp11Processor.java,org/apache/catalina/tribes/group/interceptors/TestOrderInterceptor.java,org/apache/catalina/tribes/group/interceptors/TestTcpFailureDetector.java,org/apache/catalina/servlets/TestDefaultServletOptions.java,org/apache/catalina/nonblocking/TestNonBlockingAPI.java,org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java,org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java,org/apache/tomcat/websocket/TestWsWebSocketContainer.java,org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java,jakarta/servlet/http/TestHttpServletResponseSendError.java,org/apache/catalina/core/TestAsyncContextImpl.java,org/apache/catalina/servlets/TestWebdavServletOptions.java,org/apache/catalina/servlets/TestDefaultServletEncodingWithoutBom.java,org/apache/catalina/servlets/TestDefaultServletEncodingWithBom.java,org/apache/catalina/authenticator/TestFormAuthenticator.java,org/apache/naming/TestEnvEntry.java,org/apache/tomcat/util/net/TestSSLHostConfigCompat.java,org/apache/tomcat/websocket/pojo/TestPojoEndpointBase.java,org/apache/jasper/compiler/TestJspDocumentParser.java,org/apache/catalina/valves/rewrite/TestRewriteValve.java,org/apache/jasper/compiler/TestEncodingDetector.java,org/apache/catalina/core/TestApplicationContextGetRequestDispatcher.java,org/apache/jasper/compiler/TestParser.java,org/apache/coyote/http2/TestStreamQueryString.java,org/apache/coyote/http11/TestHttp11InputBuffer.java,org/apache/coyote/http11/TestHttp11InputBufferCRLF.java,org/apache/tomcat/util/net/TestSsl.java,org/apache/coyote/ajp/TestAbstractAjpProcessor.java,org/apache/catalina/tribes/group/TestGroupChannelSenderConnections.java,org/apache/coyote/http2/TestHttp2Section_6_8.java,org/apache/catalina/tribes/group/TestGroupChannelStartStop.java,org/apache/catalina/tribes/group/TestGroupChannelMemberArrival.java,org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java,org/apache/el/TestELInJsp.java,org/apache/coyote/TestIoTimeouts.java,org/apache/catalina/connector/TestMaxConnections.java,org/apache/coyote/http2/TestAsync.java,org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java,org/apache/catalina/tribes/group/interceptors/TestNonBlockingCoordinator.java \ No newline at end of file + - name: Git Checkout + uses: actions/checkout@v2 + - name: Set up Java + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Build + run: | + ant -noinput echoproperties deploy embed test-nio test-status + env: + ANT_OPTS: -Dtest.openssl.exists=false -Dtest.excludePerformance=true -Dtest.exclude=**/TestHttp2Limits.java,org/apache/catalina/connector/TestRequest.java,org/apache/coyote/http11/filters/TestChunkedInputFilter.java,org/apache/catalina/startup/TestTomcat.java,org/apache/coyote/http2/TestHttp2Timeouts.java,org/apache/catalina/core/TestAsyncContextStateChanges.java,org/apache/catalina/valves/TestStuckThreadDetectionValve.java,org/apache/coyote/http11/TestHttp11Processor.java,org/apache/catalina/tribes/group/interceptors/TestOrderInterceptor.java,org/apache/catalina/tribes/group/interceptors/TestTcpFailureDetector.java,org/apache/catalina/servlets/TestDefaultServletOptions.java,org/apache/catalina/nonblocking/TestNonBlockingAPI.java,org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java,org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java,org/apache/tomcat/websocket/TestWsWebSocketContainer.java,org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java,jakarta/servlet/http/TestHttpServletResponseSendError.java,org/apache/catalina/core/TestAsyncContextImpl.java,org/apache/catalina/servlets/TestWebdavServletOptions.java,org/apache/catalina/servlets/TestDefaultServletEncodingWithoutBom.java,org/apache/catalina/servlets/TestDefaultServletEncodingWithBom.java,org/apache/catalina/authenticator/TestFormAuthenticator.java,org/apache/naming/TestEnvEntry.java,org/apache/tomcat/util/net/TestSSLHostConfigCompat.java,org/apache/tomcat/websocket/pojo/TestPojoEndpointBase.java,org/apache/jasper/compiler/TestJspDocumentParser.java,org/apache/catalina/valves/rewrite/TestRewriteValve.java,org/apache/jasper/compiler/TestEncodingDetector.java,org/apache/catalina/core/TestApplicationContextGetRequestDispatcher.java,org/apache/jasper/compiler/TestParser.java,org/apache/coyote/http2/TestStreamQueryString.java,org/apache/coyote/http11/TestHttp11InputBuffer.java,org/apache/coyote/http11/TestHttp11InputBufferCRLF.java,org/apache/tomcat/util/net/TestSsl.java,org/apache/coyote/ajp/TestAbstractAjpProcessor.java,org/apache/catalina/tribes/group/TestGroupChannelSenderConnections.java,org/apache/coyote/http2/TestHttp2Section_6_8.java,org/apache/catalina/tribes/group/TestGroupChannelStartStop.java,org/apache/catalina/tribes/group/TestGroupChannelMemberArrival.java,org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java,org/apache/el/TestELInJsp.java,org/apache/coyote/TestIoTimeouts.java,org/apache/catalina/connector/TestMaxConnections.java,org/apache/coyote/http2/TestAsync.java,org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java,org/apache/catalina/tribes/group/interceptors/TestNonBlockingCoordinator.java diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000000..a62cfbcf8d55 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,36 @@ +# 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 +# +# 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. + +name: Lint + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + lint: + name: 🧹 Markdown and YAML + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: yaml-lint + uses: ibiqlik/action-yamllint@v3 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - run: npm install -g markdownlint-cli@0.23.2 + - run: markdownlint '**/*.md' --ignore node_modules diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 000000000000..5fa13a03f2cb --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,29 @@ +# 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 +# +# 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. + +# MD001/heading-increment/header-increment +MD001: false + +# MD004/ul-style +MD004: false + +# MD013/line-length +MD013: false + +# MD014/commands-show-output +MD014: false + +# MD026/no-trailing-punctuation +MD026: false + +# MD040/fenced-code-language +MD040: false diff --git a/.travis.yml b/.travis.yml index d72513a1e516..86d5035b957a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,77 +16,77 @@ dist: bionic language: java jobs: - include: - - arch: s390x - jdk: openjdk11 - - arch: arm64 - jdk: oraclejdk8 - - arch: ppc64le - jdk: oraclejdk8 + include: + - arch: s390x + jdk: openjdk11 + - arch: arm64 + jdk: oraclejdk8 + - arch: ppc64le + jdk: oraclejdk8 addons: - apt: - packages: - - ant - - build-essential - - automake - - autoconf - - tar - - libssl-dev - - subversion - - git - - libtool-bin + apt: + packages: + - ant + - build-essential + - automake + - autoconf + - tar + - libssl-dev + - subversion + - git + - libtool-bin install: - - ARCH=`uname -p` - - echo $ARCH - - JDK_X64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u252b09.tar.gz" - - JDK_ARM64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz" - - JDK_s390x="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.7_10.tar.gz" - - JDK_ppc64le="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_ppc64le_linux_hotspot_8u252b09.tar.gz" - - if test "X$ARCH" = "Xaarch64"; then JDK_URL=$JDK_ARM64; elif test "$ARCH" = "ppc64le"; then JDK_URL=$JDK_ppc64le; elif test "$ARCH" = "s390x"; then JDK_URL=$JDK_s390x; else JDK_URL=$JDK_X64; fi - - wget -q $JDK_URL && tar xzf OpenJDK*.tar.gz - - if test "$ARCH" = "s390x"; then mv jdk-11* jdk; else mv jdk8* jdk; fi - - export JAVA_HOME=`pwd`/jdk - - wget -q https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.9-bin.tar.gz && tar xzf apache-ant-*-bin.tar.gz - - export ANT_HOME=`pwd`/apache-ant-1.10.9 - - export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH" - - java -version - - ant -version - - rm -rf $HOME/tmp - - export CURR_PWD=`pwd` - - svn co -q https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x/ $HOME/tmp/apr - - cd $HOME/tmp/apr - - ./buildconf - - ./configure --prefix=$HOME/tmp/apr-build - - make - - make install - - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/tmp/apr-build/lib" - - git clone -q https://github.com/apache/tomcat-native.git $HOME/tmp/tomcat-native - - cd $HOME/tmp/tomcat-native/native - - sh buildconf --with-apr=$HOME/tmp/apr - - ./configure --with-apr=$HOME/tmp/apr --with-java-home=$JAVA_HOME --with-ssl=yes --prefix=$HOME/tmp/tomcat-native-build - - make - - make install - - cd $CURR_PWD - - yes | cp build.properties.default build.properties - - echo >> build.properties - - echo "test.threads=8" >> build.properties - - echo "test.relaxTiming=true" >> build.properties - - echo "test.excludePerformance=true" >> build.properties - - echo "test.openssl.path=/dev/null/openssl" >> build.properties - - echo "test.apr.loc=$HOME/tmp/tomcat-native-build/lib" >> build.properties + - ARCH=`uname -p` + - echo $ARCH + - JDK_X64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u252b09.tar.gz" + - JDK_ARM64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz" + - JDK_s390x="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.7_10.tar.gz" + - JDK_ppc64le="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_ppc64le_linux_hotspot_8u252b09.tar.gz" + - if test "X$ARCH" = "Xaarch64"; then JDK_URL=$JDK_ARM64; elif test "$ARCH" = "ppc64le"; then JDK_URL=$JDK_ppc64le; elif test "$ARCH" = "s390x"; then JDK_URL=$JDK_s390x; else JDK_URL=$JDK_X64; fi + - wget -q $JDK_URL && tar xzf OpenJDK*.tar.gz + - if test "$ARCH" = "s390x"; then mv jdk-11* jdk; else mv jdk8* jdk; fi + - export JAVA_HOME=`pwd`/jdk + - wget -q https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.9-bin.tar.gz && tar xzf apache-ant-*-bin.tar.gz + - export ANT_HOME=`pwd`/apache-ant-1.10.9 + - export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH" + - java -version + - ant -version + - rm -rf $HOME/tmp + - export CURR_PWD=`pwd` + - svn co -q https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x/ $HOME/tmp/apr + - cd $HOME/tmp/apr + - ./buildconf + - ./configure --prefix=$HOME/tmp/apr-build + - make + - make install + - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/tmp/apr-build/lib" + - git clone -q https://github.com/apache/tomcat-native.git $HOME/tmp/tomcat-native + - cd $HOME/tmp/tomcat-native/native + - sh buildconf --with-apr=$HOME/tmp/apr + - ./configure --with-apr=$HOME/tmp/apr --with-java-home=$JAVA_HOME --with-ssl=yes --prefix=$HOME/tmp/tomcat-native-build + - make + - make install + - cd $CURR_PWD + - yes | cp build.properties.default build.properties + - echo >> build.properties + - echo "test.threads=8" >> build.properties + - echo "test.relaxTiming=true" >> build.properties + - echo "test.excludePerformance=true" >> build.properties + - echo "test.openssl.path=/dev/null/openssl" >> build.properties + - echo "test.apr.loc=$HOME/tmp/tomcat-native-build/lib" >> build.properties script: - - ant -q clean - - travis_wait 60 "./.travis/antTest.sh" + - ant -q clean + - travis_wait 60 "./.travis/antTest.sh" after_failure: - - tail -n 5000 ant-test.log - - tail -n 5000 test-failures.log - - ls -laR $HOME/tomcat-build-libs + - tail -n 5000 ant-test.log + - tail -n 5000 test-failures.log + - ls -laR $HOME/tomcat-build-libs notifications: - email: - - dev@tomcat.apache.org + email: + - dev@tomcat.apache.org diff --git a/.yamllint b/.yamllint new file mode 100644 index 000000000000..2b0c14692030 --- /dev/null +++ b/.yamllint @@ -0,0 +1,20 @@ +# 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 +# +# 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. +--- + +extends: default + +rules: + brackets: disable + document-start: disable + line-length: disable + truthy: disable diff --git a/README.md b/README.md index ec1353d13b6c..5d39ad6b7cf0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -## Welcome to Apache Tomcat! +# Welcome to Apache Tomcat! -### What Is It? +## What Is It? The Apache Tomcat® software is an open source implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket @@ -24,11 +24,12 @@ these users and their stories are listed on the Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache Tomcat project logo are trademarks of the Apache Software Foundation. -### Get It +## Get It For every major Tomcat version there is one download page containing links to the latest binary and source code downloads, but also links for browsing the download directories and archives: + - [Tomcat 10](https://tomcat.apache.org/download-10.cgi) - [Tomcat 9](https://tomcat.apache.org/download-90.cgi) - [Tomcat 8](https://tomcat.apache.org/download-80.cgi) @@ -37,26 +38,27 @@ links for browsing the download directories and archives: To facilitate choosing the right major Tomcat version one, we have provided a [version overview page](https://tomcat.apache.org/whichversion.html). -### Documentation +## Documentation The documentation available as of the date of this release is included in the docs webapp which ships with tomcat. You can access that webapp by starting tomcat and visiting in your browser. The most up-to-date documentation for each version can be found at: + - [Tomcat 10](https://tomcat.apache.org/tomcat-10.0-doc/) - [Tomcat 9](https://tomcat.apache.org/tomcat-9.0-doc/) - [Tomcat 8](https://tomcat.apache.org/tomcat-8.5-doc/) - [Tomcat 7](https://tomcat.apache.org/tomcat-7.0-doc/) -### Installation +## Installation Please see [RUNNING.txt](RUNNING.txt) for more info. -### Licensing +## Licensing Please see [LICENSE](LICENSE) for more info. -### Support and Mailing List Information +## Support and Mailing List Information * Free community support is available through the [tomcat-users](https://tomcat.apache.org/lists.html#tomcat-users) email list and @@ -76,6 +78,6 @@ list. instructions for reporting a bug [here](https://tomcat.apache.org/bugreport.html). -### Contributing +## Contributing Please see [CONTRIBUTING](CONTRIBUTING.md) for more info. diff --git a/modules/stuffed/README.md b/modules/stuffed/README.md index 79974a97d61f..7f96ce0210dd 100644 --- a/modules/stuffed/README.md +++ b/modules/stuffed/README.md @@ -30,6 +30,7 @@ Configuration is located in `conf/server.xml`, `conf/web.xml`, `conf/logging.pro ### Maven build Update Tomcat version number in the `pom.xml`, customize Tomcat components in the dependencies to keep the ones needed (only the main `tomcat-catalina` is mandatory). Custom Tomcat components sources can be added to the usual Maven build path and will be included in the package that is built. + ``` mvn clean; mvn package ``` @@ -39,11 +40,13 @@ mvn clean; mvn package ``` docker build -t apache/tomcat-stuffed:1.0 -f ./Dockerfile . ``` + Docker build arguments include `namespace` (default is `tomcat`) and `port` which should match the Tomcat port in `server.xml` (default is `8080`). Other ports that need to be exposed can be added in the `Dockerfile` as needed. Webapps should be added to the `webapps` folder where they will be auto deployed by the host if using the defaults. Otherwise, the `Dockerfile` command line can be edited like below to include the necessary resources and command line arguments to run a single or multiple hardcoded web applications. ## Running Add a webapp as folder mywebapp (for this example, or specify another path), or a path from which a configured Host will auto deploy + ``` --path: Specify a path the wepapp will use --war: Add the spcified path (directory or war) as a webapp (if no path has been specified, it will be the root webapp) @@ -74,6 +77,7 @@ An example `tomcat.yaml` is included which uses the Docker image. It uses the he ### Cluster If using the Kubernetes cloud clustering membership provider, the pod needs to have the permission to view other pods. For example with Openshift, this is done with: + ``` oc policy add-role-to-user view system:serviceaccount:$(oc project -q):default -n $(oc project -q) ``` diff --git a/modules/stuffed/tomcat.yaml b/modules/stuffed/tomcat.yaml index a85f4ad52d14..ecce7a4ed56a 100644 --- a/modules/stuffed/tomcat.yaml +++ b/modules/stuffed/tomcat.yaml @@ -32,20 +32,20 @@ spec: run: tomcat spec: containers: - - name: tomcat - image: apache/tomcat-stuffed:1.0 - ports: - - containerPort: 8080 - - containerPort: 8778 - name: jolokia - - containerPort: 9404 - name: prometheus - readinessProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 3 - periodSeconds: 3 - resources: {} + - name: tomcat + image: apache/tomcat-stuffed:1.0 + ports: + - containerPort: 8080 + - containerPort: 8778 + name: jolokia + - containerPort: 9404 + name: prometheus + readinessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 3 + periodSeconds: 3 + resources: {} strategy: {} status: {} diff --git a/res/graal/README.md b/res/graal/README.md index 717c761c1861..d6dde6632d85 100644 --- a/res/graal/README.md +++ b/res/graal/README.md @@ -37,4 +37,3 @@ This directory also contains resource directives, so that resource files normall also get compiled into the executable image. These are currently stored in a file called `tomcat-resource.json` in the `META-INF/native-image/groupId/artifactId` location. -