This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eclipse/xtext#1505] Add recreation of composite update sites
In addition, this commit moves some duplicated scripts from Jenkinsfile to external files Signed-off-by: Nico Prediger <mail@nicoprediger.de>
- Loading branch information
1 parent
a50f460
commit 5e48302
Showing
4 changed files
with
111 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
releng/jenkins/sign-and-deploy/scripts/create_composite_update_site.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/sh | ||
|
||
if [ "$1" == "milestones" ]; then | ||
REPO_NAME="TMF Xtext Update Site (Milestones)" | ||
elif [ "$1" == "releases" ]; then | ||
REPO_NAME="TMF Xtext Update Site (Releases)" | ||
else | ||
echo "Error: Missing Repository Path!" | ||
exit 1 | ||
fi | ||
|
||
cd /home/data/httpd/download.eclipse.org/modeling/tmf/xtext/updates/$1 | ||
|
||
TIMESTAMP=$(date +%s000) | ||
UPDATE_SITES=$(find . -regex '.*/content.\(xml\|jar\|xz\)' -printf "%h\n" | cut -c 3- | sort -u) | ||
NUMBER_UPDATE_SITES=$(echo "$UPDATE_SITES" | wc -l) | ||
|
||
CONTENTXML="<?xml version='1.0' encoding='UTF-8'?> | ||
<?compositeMetadataRepository version='1.0.0'?> | ||
<repository name='$REPO_NAME' | ||
type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' | ||
version='1.0.0'> | ||
<properties size='1'> | ||
<property name='p2.timestamp' value='${TIMESTAMP}'/> | ||
</properties> | ||
<children size='${NUMBER_UPDATE_SITES}'> | ||
$( | ||
for site in $UPDATE_SITES | ||
do | ||
printf " <child location='${site}'/>\n" | ||
done | ||
) | ||
</children> | ||
</repository> | ||
" | ||
|
||
echo "$CONTENTXML" > ./compositeContent.xml | ||
|
||
ARTIFACTXML="<?xml version='1.0' encoding='UTF-8'?> | ||
<?compositeArtifactRepository version='1.0.0'?> | ||
<repository name='${REPO_NAME}' | ||
type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' | ||
version='1.0.0'> | ||
<properties size='1'> | ||
<property name='p2.timestamp' value='${TIMESTAMP}'/> | ||
</properties> | ||
<children size='${NUMBER_UPDATE_SITES}'> | ||
$( | ||
for site in $UPDATE_SITES | ||
do | ||
printf " <child location='${site}'/>\n" | ||
done | ||
) | ||
</children> | ||
</repository> | ||
" | ||
|
||
echo "$ARTIFACTXML" > ./compositeArtifacts.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#/bin/bash | ||
|
||
# Returns BUILD_TYPE based on BUILD_ID | ||
# | ||
# $1 BUILD_ID | ||
# | ||
# BUILD_TYPE N=Nightly, S=Stable, R=Release | ||
|
||
if [ ! "$1" ]; then | ||
echo "Error: No BUILD_ID provided" >&2 | ||
exit 1 | ||
fi | ||
|
||
BUILD_TYPE=$(echo $1 |cut -c 1) | ||
|
||
if [ ! "$BUILD_TYPE" == "N" ] && [ ! "$BUILD_TYPE" == "S" ] && [ ! "$BUILD_TYPE" == "R" ]; then | ||
echo "Invalid BUILD_ID provided" >&2 | ||
exit 1 | ||
fi | ||
|
||
echo $BUILD_TYPE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#/bin/bash | ||
|
||
# $1 path to .properties file | ||
# $2 property name | ||
|
||
if [ ! -f "$1" ]; then | ||
echo "File not found: $1" >&2 | ||
exit 1 | ||
fi | ||
VALUE=$(grep "^$2" $1 |awk -F= '{print $2}') | ||
if [ -z "$VALUE" ]; then | ||
echo "Could not get property value" >&2 | ||
exit 1 | ||
fi | ||
echo $VALUE |