Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7e7034910800ec1c16c88ad66d59356196f5541b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/bin/bash

set -u # run with unset flag error so that missing parameters cause build failure
set -e # error out on any failed commands
set -x # echo all commands used for debugging purposes

# The commented out parameters come from Jenkinsfile
# RELEASE_NAME=
# RELEASE_MILESTONE=
# RELEASE_DIR=
# BUILD_NUMBER=
PACKAGES="committers cpp dsl embedcpp java javascript jee modeling parallel php rcp rust scout testing"
PLATFORMS="linux.gtk.aarch64.tar.gz linux.gtk.x86_64.tar.gz macosx.cocoa.x86_64.dmg win32.win32.x86_64.zip"
ARCHIVE_URL="https://ci.eclipse.org/packaging/job/simrel.epp-tycho-build/${BUILD_NUMBER}/artifact/org.eclipse.epp.packages/archive/*zip*/archive.zip"
EPP_DOWNLOADS=/home/data/httpd/download.eclipse.org/technology/epp
DOWNLOADS=${EPP_DOWNLOADS}/downloads/release/${RELEASE_NAME}/
REPO=${EPP_DOWNLOADS}/packages/${RELEASE_NAME}/

mkdir downloads
mkdir p2
pushd downloads

# ----------------------------------------------------------------------------------------------
# pull the XML configuration files that describe each package; these files are used by the
# script that generates the package websites at eclipse.org/downloads

cp ../releng/org.eclipse.epp.config/tools/functions.sh ../releng/org.eclipse.epp.config/packages_map.txt .

# ----------------------------------------------------------------------------------------------
# download the packages from the Jenkins build server
# rename the packages, i.e. strip the build date, update the package file name, and add the
# incubation name if required.

echo "wget running quietly - have a look at the workspace to track progress"
wget --quiet $ARCHIVE_URL
unzip archive.zip
pushd archive
for PACKAGE in $PACKAGES; do
  for PLATFORM in $PLATFORMS; do
    NAME=$(echo *_eclipse-${PACKAGE}-${RELEASE_NAME}-${RELEASE_MILESTONE}-${PLATFORM})
    NEWNAME=`echo ${NAME} | \
             cut -d "_" -f 2- | \
             sed 's/linux\.gtk\.aarch64\_64/linux-gtk-aarch64/' | \
             sed 's/linux\.gtk\.x86\_64/linux-gtk-x86\_64/' | \
             sed 's/win32\.win32\.x86\_64\./win32\-x86\_64\./' | \
             sed 's/macosx\.cocoa\.x86\_64/macosx\-cocoa-x86\_64/' | \
             sed 's/macosx-cocoa-x86_64.dmg/macosx-cocoa-x86_64.dmg-tonotarize/'`
    # Move and rename file
    mv ${NAME} ../${NEWNAME}
  done;
done
mv repository ../../p2
popd
# archive will be empty now, unless we are only publishing some packages
rm -rvf archive.zip archive

# place configurations in final location
for PACKAGE in $PACKAGES; do
  cp ${WORKSPACE}/packages/org.eclipse.epp.package.${PACKAGE}.feature/epp.website.xml ${PACKAGE}.xml
  cp ${WORKSPACE}/packages/org.eclipse.epp.package.${PACKAGE}.feature/feature.xml ${PACKAGE}.feature.xml
  cp ${WORKSPACE}/packages/org.eclipse.epp.package.${PACKAGE}.product/epp.product ${PACKAGE}.product.xml
done

# Rename incubation packages
INCUBATION=`ls *.xml | grep -v feature | xargs grep "product name=\"eclipse.*incubation" | sed 's/^.*\(eclipse-.*\)-incubation.*/\1/'`
echo Found ${INCUBATION} in incubation
for II in ${INCUBATION}; do
  echo ".. Renaming ${II} incubating packages"
  for INCUBATIONPACKAGE in `ls *${II}* | grep -v "incubation"`; do
    INCUBATIONPACKAGE_FILE=`echo ${INCUBATIONPACKAGE} | sed 's:\(.*\)\('${II}'\)\(.*\):\1\2-incubation\3:'`
    echo -n ".... Moving ${INCUBATIONPACKAGE} to ${INCUBATIONPACKAGE_FILE}"
    mv -i ${INCUBATIONPACKAGE} ${INCUBATIONPACKAGE_FILE}
    echo " done."
  done
done

# ----------------------------------------------------------------------------------------------
# compute the checksum files for each package

for II in eclipse*.zip eclipse*.tar.gz eclipse*.dmg-tonotarize; do
  echo .. $II
  md5sum $II >$II.md5
  sha1sum $II >$II.sha1
  sha512sum -b $II >$II.sha512
done

popd # leave downloads


# ----------------------------------------------------------------------------------------------
# Prepare compositeArtifacts.jar/compositeContent.jar
pushd p2
if [ "$RELEASE_MILESTONE" != "M1" ] && [ "$RELEASE_MILESTONE" != "R" ]; then
    # For non M1 build we need to add to the existing p2 content,
    # for M1 we start from scratch

    # For R build the composite should have just the release in it
    cp -rp ${REPO}/* .
fi
mv repository ${RELEASE_DIR}
cat > addmilestone.xml <<EOM
<?xml version="1.0" encoding="UTF-8"?>
<project name="p2 composite repository">
  <target name="default">
    <p2.composite.repository>
      <repository compressed="true" location="." name="${RELEASE_NAME}" />
      <add>
        <repository location="${RELEASE_DIR}" />
      </add>
    </p2.composite.repository>
  </target>
</project>
EOM

# Use the eclipse we have to build p2 with
tar xf ../downloads/eclipse-committers-*-linux-gtk-x86_64.tar.gz
./eclipse/eclipse \
    -application org.eclipse.ant.core.antRunner \
    -buildfile addmilestone.xml \
    default
rm -rf eclipse

cat > p2.index <<EOM
version=1
metadata.repository.factory.order=compositeContent.xml,\!
artifact.repository.factory.order=compositeArtifacts.xml,\!
EOM

popd # leave p2

# ----------------------------------------------------------------------------------------------
# Make the new https://download.eclipse.org/technology/epp/downloads/release/release.xml file
# The release.xml file is used by Eclipse Webmaster to populate eclipse.org/downloads
cat > release.xml <<EOM
<packages>
<past>2019-03/R</past>
<past>2019-06/R</past>
<past>2019-09/R</past>
<past>2019-12/R</past>
<past>2020-03/R</past>
<past>2020-06/R</past>
<present>2020-09/R</present>
<future>2020-12/M1</future>
</packages>
EOM

# ----------------------------------------------------------------------------------------------
# Copy everything to download.eclipse.org

ECHO=echo
if [ "$DRY_RUN" == "false" ]; then
    ECHO=""
else
    echo Dry run of build:
fi

${ECHO} mkdir -p ${DOWNLOADS}/${RELEASE_DIR}
${ECHO} mkdir -p ${REPO}
${ECHO} cp -r downloads/* ${DOWNLOADS}/${RELEASE_DIR}
${ECHO} cp -r p2/p2.index ${REPO}
${ECHO} cp -r p2/${RELEASE_DIR} ${REPO}
${ECHO} cp p2/compositeArtifacts.jar ${REPO}/compositeArtifacts${RELEASE_MILESTONE}.jar
${ECHO} cp p2/compositeContent.jar ${REPO}/compositeContent${RELEASE_MILESTONE}.jar
${ECHO} cp release.xml ${EPP_DOWNLOADS}/downloads/release/release.xml

Back to the top