From a5a9c7ba2752c7fa2cc321263015e9ee43bf63a0 Mon Sep 17 00:00:00 2001 From: Andreas Wilson <41663792+andrwils@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:16:51 -0700 Subject: [PATCH] feat: use adoptium openjdk (#6) * feat: use adoptium for openjdk 8 * feat: set context to pub * feat: increase deploy timout * feat: use adoptium * feat: decrease deployment timeout * feat: use adoptium api * feat: use proxy for jdk * feat: use tomcat 9 * feat: display java and tomcat version * feat: use default jdk (#5) --- .github/workflows/deploy.yaml | 4 ++-- playbooks/playbook.yaml | 11 +++-------- playbooks/vars/standard/all.yaml | 2 +- src/main/webapp/index.jsp | 4 ++++ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d1d2dd9..fa49967 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -174,6 +174,6 @@ jobs: ARTIFACT_SHA256: ${{ needs.deploy-build.outputs.artifact_sha256 || needs.deploy-tag.outputs.artifact_sha256 }} DOWNLOAD_URL: ${{ needs.deploy-build.outputs.download_url || needs.deploy-tag.outputs.download_url }} # The automatically generated GitHub token will expire when the workflow ends. We need to wait so the job has time to clone the repo. - - name: Sleep for 30 seconds - run: sleep 30s + - name: Sleep + run: sleep 90s shell: bash diff --git a/playbooks/playbook.yaml b/playbooks/playbook.yaml index 0f27aa1..b0da4a2 100644 --- a/playbooks/playbook.yaml +++ b/playbooks/playbook.yaml @@ -19,20 +19,15 @@ # individual JDK installation - name: jdk vars: - jdk_version: - type: 'openjdk' - major_version: 8 - url: '{{ artifactory_url }}/ext-binaries-local/openjdk/java-se-8u40-ri.tar.gz' - filename: 'java-se-8u40-ri.tar.gz' - checksum: 'sha1:606984531e3eeddba6be5ac626a229ef283c5de0' - cacerts_path: 'jre/lib/security/cacerts' - use_proxy: false + proxy_env: "{{ env_vars }}" # create a self signed certificate to allow for HTTPS - name: self_signed_cert # install & configure the Tomcat container - name: tomcat + vars: + tomcat_major_version: '9' # deploy the webapp - name: webapp diff --git a/playbooks/vars/standard/all.yaml b/playbooks/vars/standard/all.yaml index bd319a2..454bd0d 100644 --- a/playbooks/vars/standard/all.yaml +++ b/playbooks/vars/standard/all.yaml @@ -16,7 +16,7 @@ pd_prop_build_number: "{{ lookup('ansible.builtin.env', 'PODMAN_BUILD_NUMBER') } pd_prop_service_install_directory: "{{ pd_prop_project_version }}-{{ pd_prop_build_number }}" # The following properties are custom to each particular service -context: ext#oneteam-example +context: pub#oneteam-example # By default, the Tomcat port is set dynamically by using the port_manager role # If you need to set a static port, replace the dynamic port assignment value with your static value diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 45a168a..aaa6ba1 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -21,11 +21,15 @@ e.printStackTrace(); } String timestamp = (String) application.getAttribute("deploymentTimestamp"); + String javaRuntimeVersion = System.getProperty("java.runtime.version"); + String tomcatVersion = application.getServerInfo(); %>

Hello World!

Version: <%= version %>

Deployed at: <%= timestamp %>

+

Java Runtime: <%= javaRuntimeVersion %>

+

Tomcat Version: <%= tomcatVersion %>

\ No newline at end of file