diff --git a/.github/workflows/triggerConversion.yml b/.github/workflows/triggerConversion.yml new file mode 100644 index 0000000..78c83f2 --- /dev/null +++ b/.github/workflows/triggerConversion.yml @@ -0,0 +1,31 @@ +name: Rebuild cloud-hosted guide + +# Controls when the action will run. Triggers the workflow on push +# events but only for the main branch +on: + push: + branches: + - 'prod' + - 'staging' + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "post" + post: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + # Uses the secrets from the organisation for credentials + - uses: actions/checkout@v2 + + - name: Invoke workflow in another repo with inputs + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: GuideConverter + repo: OpenLiberty/cloud-hosted-guides + token: ${{ secrets.GUIDECONVERSIONTOOL_PASSWORD }} + inputs: '{ "branch": "${{ github.ref }}", "guide_name": "${{ github.event.repository.name }}" }' + ref: "refs/heads/prod" \ No newline at end of file diff --git a/README.adoc b/README.adoc index 50261b5..f0fc5c6 100644 --- a/README.adoc +++ b/README.adoc @@ -62,10 +62,12 @@ automated test and configure Maven to automatically run the test. == Installing Maven +ifndef::cloud-hosted[] If Maven isn't already installed, https://maven.apache.org/download.cgi[download the binary zip or tar.gz file^]. Then, follow the https://maven.apache.org/install.html[installation instructions for your operating system^] to extract the `.zip` file and add the `bin` directory, which contains the `mvn` command to the `PATH` on your computer. +endif::[] Run the following command to test that Maven is installed: @@ -118,8 +120,20 @@ The guideServer server is ready to run a smarter planet. ---- // end::runCommand[] - +ifndef::cloud-hosted[] Navigate your browser to the http://localhost:9080/ServletSample/servlet[^] URL to access the application. The servlet returns a simple response of `Hello! How are you today?`. +endif::[] + +ifdef::cloud-hosted[] +Select **Terminal** > **New Terminal** from the menu of the IDE to open another command-line session. +Run the following curl command to view the output of the application: +``` +curl -s http://localhost:9080/ServletSample/servlet +``` +{: codeblock} + +The servlet returns a simple response of **Hello! How are you today?**. +endif::[] [role='command'] include::{common-includes}/twyb-end.adoc[] @@ -153,12 +167,19 @@ All the application source code, including the Open Liberty server configuration == Creating the project POM file Navigate to the `start` directory to begin. +// cloud hosted instructions +ifdef::cloud-hosted[] +``` +cd /home/project/guide-maven-intro/start +``` +{: codeblock} +endif::[] Before you can build the project, define the Maven Project Object Model (POM) file, the `pom.xml`. [role="code_command hotspot", subs="quotes"] ---- -#Create the pom.xml file.# +#Create the pom.xml file in the `start` directory.# `pom.xml` ---- @@ -174,15 +195,9 @@ element and a [hotspot=modelVersion file=0]`modelversion` element, which is alwa A typical POM for a Liberty application contains the following sections: * **Project coordinates**: The identifiers for this application. -* **Properties** ([hotspot=properties file=0]`properties`): Any properties for the project go here, -including compilation details and any values that are referenced during compilation of the -Java source code and generating the application. -* **Dependencies** ([hotspot=dependencies file=0]`dependencies`): Any Java dependencies that are -required for compiling, testing, and running the application are listed here. -* **Build plugins** ([hotspot=build file=0]`build`): Maven is modular and each of its -capabilities is provided by a separate plugin. This is where you specify which Maven -plugins should be used to build this project and any configuration information needed by -those plugins. +* **Properties** ([hotspot=properties file=0]`properties`): Any properties for the project go here, including compilation details and any values that are referenced during compilation of the Java source code and generating the application. +* **Dependencies** ([hotspot=dependencies file=0]`dependencies`): Any Java dependencies that are required for compiling, testing, and running the application are listed here. +* **Build plugins** ([hotspot=build file=0]`build`): Maven is modular and each of its capabilities is provided by a separate plugin. This is where you specify which Maven plugins should be used to build this project and any configuration information needed by those plugins. The project coordinates describe the name and version of the application. The [hotspot=artifactID file=0]`artifactId` gives a name to the web application project, which is used to @@ -245,8 +260,20 @@ include::finish/src/main/liberty/config/server.xml[] [role='command'] include::{common-includes}/devmode-lmp33-start.adoc[] +ifndef::cloud-hosted[] Navigate your browser to the http://localhost:9080/ServletSample/servlet[^] URL to access the application. The servlet returns a simple response of `Hello! How are you today?`. +endif::[] + +ifdef::cloud-hosted[] +Select **Terminal** > **New Terminal** from the menu of the IDE to open another command-line session. +Run the following curl command to view the output of the application: +``` +curl -s http://localhost:9080/ServletSample/servlet +``` +{: codeblock} +The servlet returns a simple response of **Hello! How are you today?**. +endif::[] // ================================================================================================= // Testing the web application // ================================================================================================= diff --git a/finish/pom.xml b/finish/pom.xml index fddff0e..9f6b455 100644 --- a/finish/pom.xml +++ b/finish/pom.xml @@ -46,7 +46,7 @@ org.eclipse.microprofile microprofile - 4.0.1 + 4.1 pom provided @@ -65,7 +65,7 @@ org.junit.jupiter junit-jupiter - 5.7.1 + 5.8.1 test @@ -81,13 +81,13 @@ org.apache.maven.plugins maven-war-plugin - 3.3.1 + 3.3.2 io.openliberty.tools liberty-maven-plugin - 3.3.4 + 3.5.1 diff --git a/scripts/dailyBuild.sh b/scripts/dailyBuild.sh index 196135d..3be3f66 100755 --- a/scripts/dailyBuild.sh +++ b/scripts/dailyBuild.sh @@ -8,7 +8,7 @@ do esac done -sed -i "\#liberty-maven-plugin#,\##cliberty-maven-plugin3.3.4https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/nightly/$DATE/$DRIVER" pom.xml +sed -i "\#liberty-maven-plugin#,\##cliberty-maven-plugin3.5https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/nightly/$DATE/$DRIVER" pom.xml cat pom.xml ../scripts/testApp.sh