-
-
Save lucaswerkmeister/1de294ea6f52223cd524eb37e3d19477 to your computer and use it in GitHub Desktop.
ceylond reproducible build script
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
#!/bin/bash | |
languageVersion=1.3.1 | |
projectVersion=1.0.0 | |
repoUser=lucaswerkmeister | |
repoName=ceylond | |
modules=(de.lucaswerkmeister.ceylond.{core,recordBased,packetBased,daemonizeProgram}) | |
repo=https://modules.ceylon-lang.org/repo/1 | |
timestamp=1484820000 | |
# install dependencies | |
apt install --yes --allow-unauthenticated \ | |
git \ | |
default-jre \ | |
wget \ | |
curl \ | |
ant \ | |
zip \ | |
unzip \ | |
libarchive-zip-perl \ | |
python3 \ | |
nodejs | |
# install Ceylon | |
cd /opt | |
wget https://downloads.ceylon-lang.org/cli/ceylon-${languageVersion}_${languageVersion}-1_all.deb | |
dpkg -i ceylon-${languageVersion}_${languageVersion}-1_all.deb | |
# build project | |
git clone https://github.com/$repoUser/$repoName | |
cd $repoName | |
git checkout $projectVersion | |
sed -i "s ../ceylon/dist/dist /usr/share/ceylon/${languageVersion}/ " build.properties | |
ant compile | |
cd .. | |
# strip nondeterminism | |
git clone https://github.com/lucaswerkmeister/strip-nondeterminism | |
cd strip-nondeterminism | |
for module in "${modules[@]}"; do | |
car="../$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car" | |
perl -I lib -- bin/strip-nondeterminism -t car -T $timestamp "$car" | |
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1 | |
done | |
cd .. | |
# compare checksums | |
for module in "${modules[@]}"; do | |
echo | |
echo "$module" | |
cat "$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo | |
curl "$repo/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment