Skip to content

Commit

Permalink
to update plugin versions programatically
Browse files Browse the repository at this point in the history
  • Loading branch information
navaneethsnair1 authored and natalie-bernhard committed May 6, 2024
1 parent 7fb0647 commit d4baa5f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
19 changes: 18 additions & 1 deletion src/main/content/_assets/js/builds.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ var versArr = [];

var builds_url = '/api/builds/data';
var starter_domain =
isNotProdSite() ? 'https://starter-staging.rh9j6zz75er.us-east.codeengine.appdomain.cloud' : 'https://start.openliberty.io';
isNotProdSite() ? 'https://starter-staging.rh9j6zz75er.us-east.codeengine.appdomain.cloud' : 'https://localhost:9443';
var starter_info_url = starter_domain + '/api/start/info';
var starter_submit_url = starter_domain + '/api/start';
var starter_plugin_url= starter_domain+ '/api/start/plugin-versions';
var failed_builds_request = false;

// Controls what build zips are exposed on openliberty.io. This will need to be updated
Expand Down Expand Up @@ -1595,3 +1596,19 @@ $(window).on('load', function () {
}
});
});

$(window).on('load', function () {
$.ajax({
url: starter_plugin_url,
type: 'GET',
dataType: 'json',
success: function(data) {
$('#maven_version').text(data.mavenVersion);
$('#gradle_version').text(data.gradleVersion);
},
error: function(error) {
console.error('Error fetching Maven and Gradle plugin versions:', error);
}
});
});

6 changes: 2 additions & 4 deletions src/main/content/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
{% endif %}
{% capture release_blog %}{% t start.release_blog %}{% endcapture %}
<script>

var release_blog = '{{release_blog}}';

</script>
<!-- INTRO -->
<div id="downloads_intro_background">
Expand Down Expand Up @@ -162,7 +160,7 @@ <h2 id="getOL" class="section_title"><a class="anchor" href="#getOL"></a>{% t st
<div class="code_block_wrapper" title="Code block">
<div class="copied_confirmation">Copied to clipboard</div>
<input type="image" class="copy_to_clipboard" src="/img/guides_copy_button.svg" alt="Copy code block" title="Copy code block"/>
<pre class="code_container">&lt;plugin&gt;<br> &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt;<br> &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt;<br> &lt;version&gt;<span class="latest_version">3.10.2</span>&lt;/version&gt;<br>&lt;/plugin&gt;</pre>
<pre class="code_container">&lt;plugin&gt;<br> &lt;groupId&gt;io.openliberty.tools&lt;/groupId&gt;<br> &lt;artifactId&gt;liberty-maven-plugin&lt;/artifactId&gt;<br> &lt;version&gt;<span class="latest_version" id="maven_version"></span>&lt;/version&gt;<br>&lt;/plugin&gt;</pre>
</div>
<p>
{% t start.add_to_existing_app.maven_guide_text %}
Expand All @@ -177,7 +175,7 @@ <h2 id="getOL" class="section_title"><a class="anchor" href="#getOL"></a>{% t st
<div class="code_block_wrapper" title="Code block">
<div class="copied_confirmation">Copied to clipboard</div>
<input type="image" class="copy_to_clipboard" src="/img/guides_copy_button.svg" alt="Copy code block" title="Copy code block"/>
<pre class="code_container">buildscript { <br> repositories { <br> mavenCentral()<br> }<br> dependencies {<br> classpath 'io.openliberty.tools:liberty-gradle-plugin:'<span class="latest_version">3.8.2</span>'<br> }<br>}</pre>
<pre class="code_container">buildscript { <br> repositories { <br> mavenCentral()<br> }<br> dependencies {<br> classpath 'io.openliberty.tools:liberty-gradle-plugin:'<span class="latest_version" id="gradle_version"></span>'<br> }<br>}</pre>
</div>
<p>The plugin also needs to be applied in the build file in order to be utilized.</p>
<div class="code_block_wrapper" title="Code block">
Expand Down

0 comments on commit d4baa5f

Please sign in to comment.