Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/callable-url-updater-4-tool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Callable url updater for tool
run-name: Nightly update of URLs

# Controls when the workflow will run
on:
workflow_dispatch:

#schedule:
# - cron: '56 09 * * *'
jobs:

testUpdater:
runs-on: ubuntu-latest
steps:
- name: Checkout ide
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Build and run url updater
run: |
cd cli
mvn -B -ntp -DskipTests -Dstyle.color=always install

# Update URLS from matrix (list)
IDEasy-update-urls:
runs-on: ubuntu-latest
needs: [ testUpdater ]
strategy:
matrix:
tool-name: [ jmc, pip, jasypt ]
fail-fast: false
steps:
- name: Checkout ide
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Build and run url updater
run: |
toolName="${{ matrix.tool-name }}"
echo "ToolName: [$toolName]"
if [ "$toolName" != null ] && [ ! -z "$toolName" ]
then
cd cli
mkdir ../ide-urls
mvn -B -ntp -Dstyle.color=always -DskipTests install
mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M $toolName"
else
echo "ERROR: Updater not startet due tool-name is null or empty"
fi

#
#
#
# uses: hj-lorenz/IDEasy/.github/workflows/update-urls.yml@main
# with:
# tool-name: ${{ matrix.tool-name }}
# secrets: inherit

117 changes: 117 additions & 0 deletions .github/workflows/dynamic-parallel-url-updater-with-strategy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Dynamic parallel URL update (strategy matrix)
run-name: Nightly update of URLs

# Controls when the workflow will run
on:
workflow_dispatch:

#schedule:
# - cron: '56 09 * * *'

jobs:
#Execute unit tests for updater only once
testUpdater:
runs-on: ubuntu-latest
steps:
- name: Checkout ide
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Build and run url updater
run: |
cd cli
mvn -B -ntp -DskipTests -Dstyle.color=always install

# Create list of tools dynamically
create-tool-list:
name: create-tool-list
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: Checkout ide
uses: actions/checkout@v3
with:
submodules: recursive
- name: PWD
run: |
pwd
- name: Create-Urls-4-test
run: |
cd cli/..
pwd
mkdir ide-urls
mkdir ide-urls/pip
mkdir ide-urls/jasypt
mkdir ide-urls/eclipse
mkdir ide-urls/eclipse/cpp
pwd
cd ide-urls/eclipse/
ls -l
- name: Set Matrix
id: set-matrix
# Nachfolgende Statements waren div. Versuche die Liste der Tools zu erstellen, anfangs noch ohne json-Format
# echo "name=matrix::$(ls -lRd * | grep '^d' | gawk '{printf("%s, ",$9)}' | sed -e 's/,\ *$//')" >> $GITHUB_OUTPUT
# echo "matrix=${{for i in `find -maxdepth 2 -type d`; do echo `basename $i`; done | grep -v "^\." | sort -u | awk 'BEGIN{printf("\047[")} {printf("%s, ",$1)}' | sed -e "s/,\ *$/]'/"}}" >> $GITHUB_OUTPUT
# matrix=${{'[cpp,eclipse]'}} >> $GITHUB_OUTPUT
# pwd
# cd cli/../ide-urls
# for i in `find -maxdepth 2 -type d`; do echo `basename $i`; done | grep -v "^\." | sort -u | awk 'BEGIN{printf("\047[")} {printf("%s, ",$1)}' | sed -e "s/,\ *$/]'/"
# echo "matrix=${{env.TOOLS}}"
# echo "matrix=${{env.TOOLS}}" >> $GITHUB_OUTPUT

# Nachfolgende runs waren Versuche die json zu erzeugen.
# run: echo "matrix=$(jq -cr '@json' <<< "${{ env.TOOLS }}")" >> $GITHUB_OUTPUT
# run: echo "::set-output name=matrix::{[{\"cpp\"}, {\"jasypt\"}]}"
# run echo "::set-output name=matrix::{\"tools\":[{\"tool\":\"eclipse\"},{\"tool\":\"jmc\"}]}"
run: |
toolsAsJson=$(for i in `find ide-urls/. -maxdepth 2 -type d`; do echo `basename $i`; done | grep -v "^\." | sort -u | awk 'BEGIN{printf("{\"tools\":[")} {printf("{\"tool\":\"%s\"},",$1)}' | sed -e "s/,\ *$/]}/")
echo $toolsAsJson
echo "::set-output name=matrix::`echo $toolsAsJson`"

# HINWEIS: Funktioniert nur, wenn die tools initial mindestens 1x bereits heruntergeladen wurden.
# Optional: Parameter beim manuellen Aufruf, der mit der eine Liste übergeben werden kann.
# * 3 Scripte
# 1. zentrales callable script mit input-Parameter. (nutzt matrix)
# 2. Aufrufer-Script für Erstellen der Matrix aus Input-Parametern
# 3. Aufrufer-Script zum dynamischen Ermitteln der bereits existierenden Tools

# Update URLS from matrix (list)
IDEasy-update-urls:
runs-on: ubuntu-latest
needs: [ testUpdater, create-tool-list ]
strategy:
matrix:
${{ fromJson(needs.create-tool-list.outputs.matrix.tools) }}
fail-fast: false
steps:
- name: Checkout ide
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Build and run url updater
run: |
toolName=${{ matrix.tools }}
echo "ToolName: [$toolName]"
if [ "$toolName" != null ] && [ ! -z "$toolName" ]
then
cd cli
mkdir ../ide-urls
mvn -B -ntp -Dstyle.color=always -DskipTests install
mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT1M $toolName"
else
echo "ERROR: Updater not startet due tool-name is null or empty"
fi
33 changes: 33 additions & 0 deletions .github/workflows/update-urls(for-test).yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update Urls (callable)
run-name: ${{ github.actor }} executes url update on ${{ github.ref_name }} 🚀

on:
workflow_dispatch:

workflow_call:
inputs:
tool-name:
required: false
type: string

jobs:
updateURLS:
runs-on: ubuntu-latest
steps:
- name: Checkout ide
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Build and run url updater
run: |
toolName="${{ inputs.tool-name }}"
cd cli
mkdir ../ide-urls
mvn -B -ntp -Dstyle.color=always -DskipTests install
mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M $toolName"
4 changes: 2 additions & 2 deletions .github/workflows/update-urls.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Update URLS
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
# schedule:
# - cron: '0 3 * * *'
jobs:
updateURLS:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
.*
!.gitignore
!.gitkeep
!.github
!.editorconfig
!.ide.software.version
!.devon.software.version
!.ide
!.anyedit.properties
!.ide.properties
!.templateengine
!.yml
target/
eclipse-target/
generated/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,9 @@ protected void updateExistingVersions(UrlEdition edition) {
String[] existingVersions = edition.getChildNames().toArray(i -> new String[i]);
for (String version : existingVersions) {
UrlVersion urlVersion = edition.getChild(version);
if (isTimeoutExpired()) {
break;
}
if (urlVersion != null) {
UrlStatusFile urlStatusFile = urlVersion.getOrCreateStatus();
StatusJson statusJson = urlStatusFile.getStatusJson();
Expand Down