Skip to content

Commit 11bff68

Browse files
committed
Add Dockerfile for local F-Droid builds
1 parent 0c6fbca commit 11bff68

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

ci/containers/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ You're going to have to do this as root unless you have rootless containers set
1010
* remove the container:
1111
```podman rm linux-build```
1212
* remove the image:
13-
```podman image rm linux-build:latest```
13+
```podman image rm linux-build:latest```
14+
15+
## F-Droid container
16+
* building the image
17+
``` podman build -t fdroid --network=host -f ci/containers/fdroid-build.dockerfile```
18+
* run a build against the latest metadata version (run in fdroiddata repo)
19+
``` podman run --rm -v $(pwd):/repo -v /opt/android-sdk-linux:/opt/android-sdk -e ANDROID_HOME:/opt/android-sdk fdroid```

ci/containers/fdroid-build.dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM registry.gitlab.com/fdroid/docker-executable-fdroidserver:master
2+
3+
COPY fdroid-build.sh /
4+
5+
ENTRYPOINT ["bash", "/fdroid-build.sh"]

ci/containers/fdroid-build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/env bash
2+
3+
set -x;
4+
5+
echo "Building latest de.tutao.tutanota"
6+
VERCODE=$(grep CurrentVersionCode metadata/de.tutao.tutanota.yml | awk '{print $2}')
7+
echo "Version: $VERCODE"
8+
9+
# get all those good env vars that we need (like $fdroidserver and $home_vagrant)
10+
source /etc/profile.d/bsenv.sh;
11+
12+
# PYTHONPATH is needed to find the plugins, we need fetchsrclibs.
13+
export fdroid="sudo --preserve-env --user vagrant
14+
env PATH=$fdroidserver:$PATH
15+
env PYTHONPATH=$fdroidserver:$fdroidserver/examples
16+
env PYTHONUNBUFFERED=true
17+
env TERM=$TERM
18+
env HOME=$home_vagrant
19+
fdroid";
20+
21+
# We move the data we need into vagrant home. There are some guards against just running in the data repo.
22+
ln -s $PWD/srclibs/ $home_vagrant/srclibs;
23+
mkdir $home_vagrant/metadata;
24+
cp metadata/de.tutao.tutanota.yml $home_vagrant/metadata/;
25+
26+
# Start the build in home dir.
27+
cd $home_vagrant;
28+
# This will fetch rustup for us but not actually install anything.
29+
$fdroid fetchsrclibs de.tutao.tutanota:$VERCODE --verbose;
30+
# Run the actual build.
31+
$fdroid build --verbose --test --on-server --no-tarball de.tutao.tutanota:$VERCODE;

0 commit comments

Comments
 (0)