Skip to content

Commit 3d9e53b

Browse files
committed
Generalize applyTemplate.sh script
Take new acknowledgements file into account and simplify/unify the script in general. Follow-up on - #361
1 parent 88e8049 commit 3d9e53b

File tree

4 files changed

+28
-31
lines changed

4 files changed

+28
-31
lines changed

.github/workflows/updateRelease.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- name: Create Pull Request for Release ${{ github.event.milestone.title }}
2626
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
2727
with:
28+
author: Eclipse Releng Bot <[email protected]>
2829
commit-message: Prepare Release ${{ github.event.milestone.title }}
2930
branch: prepare_R${{ github.event.milestone.title }}
3031
title: Prepare Release ${{ github.event.milestone.title }}

news/4.x-template/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Eclipse 4.x - New and Noteworthy
22

33
Welcome to the Eclipse SDK project!
4-
The Eclipse SDK project is part of the Eclipse YYY-MM simultaneous release.
4+
The Eclipse SDK project is part of the Eclipse YYYY-MM simultaneous release.
55
The Eclipse SDK and related resources can be downloaded from the [Eclipse Project downloads](https://download.eclipse.org/eclipse/downloads/) page.
66
The Eclipse installer and other packages can be downloaded from the [IDE Downloads](https://www.eclipse.org/downloads/packages) page.
77

news/instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Eclipse New and Noteworthy Authoring
22

3-
Last revised 2025-05-08.
3+
Last revised 2025-06-01.
44

55
## Instructions
66

@@ -177,7 +177,7 @@ Every individual who made code contributions to the described change should be m
177177

178178
### Initialization
179179

180-
To create the directory and all the related content for a new release,
181-
use the [4.x-template directory](4.x-template).
182-
Replace `4.x` in the markdown files with the Eclipse project's release version
183-
and replace `YYYY-MM` with the corresponding SimRel release name.
180+
To automatically initialize the news folder for a new release, run the `scripts/applyTemplate.sh` script.
181+
Instructions to run the script can be found in `scripts/instructions.txt`.
182+
It creates the directory and all the related content for a new release, useing the [4.x-template directory](4.x-template).
183+
It also replaces the placeholder `4.x` with the Eclipse project's release version and `YYYY-MM` with the corresponding SimRel release name in all markdown files.

news/scripts/applyTemplate.sh

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
#!/bin/sh -e
2+
13
#******************************************************************************
2-
# Copyright (c) 2019 IBM Corporation and others.
4+
# Copyright (c) 2019, 2025 IBM Corporation and others.
35
#
46
# This program and the accompanying materials
57
# are made available under the terms of the Eclipse Public License 2.0
@@ -12,40 +14,34 @@
1214
# IBM Corporation - initial API and implementation
1315
#******************************************************************************
1416

15-
#!/bin/sh
16-
1717
if [ "x$1" == "x" ] || [ "x$2" == "x" ]; then
1818
echo "Usage error: Pass release version and simrel release name as arguments"
1919
echo "For example: ./applyTemplate.sh 4.13 2019-09"
2020
exit 1
2121
fi
22+
eclipseVersion=$1
23+
simRelVersion=$2
2224

23-
cd ..
24-
echo "In parent directory of scripts `pwd`"
25+
cd $(dirname $(readlink -f "$0"))/../../news
26+
echo "In news directory: $(pwd)"
2527

26-
echo "Checking if directory $1 already exists"
27-
if [ -d $1 ]
28-
then
29-
echo "Error: Directory $1 already exists. Exiting..."
28+
echo "Checking if directory ${eclipseVersion} already exists"
29+
if [ -d ${eclipseVersion} ]; then
30+
echo "Error: Directory ${eclipseVersion} already exists. Exiting..."
3031
exit 1
3132
fi
3233

33-
echo "Applying template for $1"
34-
cp -R '4.x-template' $1
35-
36-
echo "Created directory and entering $1"
37-
cd $1
38-
39-
echo "Replacing 4.x with $1 to files in `pwd`"
34+
echo "Applying template for ${eclipseVersion}"
35+
cp -R '4.x-template' ${eclipseVersion}
4036

41-
sed -i'.bak' -e "s/4\.x/$1/g" index.html
42-
sed -i'.bak' -e "s/4\.x/$1/g" jdt.html
43-
sed -i'.bak' -e "s/4\.x/$1/g" pde.html
44-
sed -i'.bak' -e "s/4\.x/$1/g" platform.html
45-
sed -i'.bak' -e "s/4\.x/$1/g" platform_isv.html
37+
echo "Created directory and entering ${eclipseVersion}"
38+
cd ${eclipseVersion}
4639

47-
echo "Replacing YYYY-MM with $2 in index.html"
48-
sed -i'.bak' -e "s/YYYY-MM/$2/g" index.html
40+
echo "Replacing 4.x with ${eclipseVersion} and YYYY-MM with ${simRelVersion} to files in $(pwd)"
4941

50-
echo "Deleting backup files"
51-
rm *.html.bak
42+
for file in *.md; do
43+
if [ -f "$file" ]; then
44+
sed -i --expression "s|4\.x|${eclipseVersion}|g" $file
45+
sed -i --expression "s|YYYY-MM|${simRelVersion}|g" $file
46+
fi
47+
done

0 commit comments

Comments
 (0)