-
Notifications
You must be signed in to change notification settings - Fork 1
/
dist.sh
executable file
·43 lines (35 loc) · 1.5 KB
/
dist.sh
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
#!/bin/bash
set -e
display_usage() {
echo -e "Usage: dist.sh <codename>\n"
}
if [ $# -lt 1 ]
then
display_usage
exit 1
fi
VERSION=$(date +"%Y%m%d%H%M%S")
CODENAME=$1
# create a skeletal debian/changelog
SINGULARITYENV_DEBFULLNAME=$DEBFULLNAME \
SINGULARITYENV_DEBEMAIL=$DEBEMAIL \
singularity exec -e $CODENAME.img dch --create --package "highorderfit" --distribution $CODENAME --newversion=$VERSION "Build for $(git rev-parse HEAD)"
# create an amd64 binary package
# using the Makefile 'debian/rules'
SINGULARITYENV_DEBFULLNAME=$DEBFULLNAME \
SINGULARITYENV_DEBEMAIL=$DEBEMAIL \
SINGULARITYENV_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
SINGULARITYENV_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
SINGULARITYENV_AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
singularity exec -e $CODENAME.img debuild -i -us -uc -b
# upload to the debian apt repository located in the
# Amazon S3 bucket. deb-s3 expects AWS_ACCESS_KEY_ID and
# AWS_SECRET_ACCESS_KEY environment variables to be set.
deb-s3 upload --bucket atmosfoam-apt --codename=$CODENAME --component=dev ../highorderfit_${VERSION}_amd64.deb
# ensure that the new .deb can be installed
sudo singularity exec -e -w $CODENAME.img add-apt-repository "http://atmosfoam-apt.s3-website-eu-west-1.amazonaws.com dev" -y
echo updating
sudo singularity exec -e -w $CODENAME.img apt-get update -qq --allow-insecure-repositories
echo installing
sudo singularity exec -e -w $CODENAME.img apt-get install highorderfit=$VERSION -y --allow-unauthenticated --no-install-recommends
git clean -xfd .