aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/targets/github-lambda.sh
blob: 2a95ca5615cc625320b0db118686c69b8da7c90d (plain)
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
build() {
    pushd build > /dev/null
    ../configure \
        CFLAGS="-Wall -g -O0" \
        --enable-ronn \
        --disable-silent-rules \
        --disable-tests \
        --disable-valgrind \
        --disable-git-receiver \
        --enable-make-embedded \
        --disable-runserver
    popd > /dev/null

    make -C build LDFLAGS="-all-static" blogc

    rm -rf build/root
    mkdir -p build/root

    PV="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)"

    install -m 755 build/blogc build/root/blogc
    install -m 644 build/src/blogc-github-lambda/lambda_function.py build/root/lambda_function.py
    install -m 644 LICENSE build/root/LICENSE
    strip build/root/blogc

    pushd build/root/ > /dev/null
    zip "../blogc-github-lambda-${PV}.zip" *
    popd > /dev/null

    install -m 755 build/root/blogc "build/blogc-static-amd64-${PV}"
    xz -z "build/blogc-static-amd64-${PV}"
}

deploy_cond() {
    [[ "x${CC}" = "xgcc" ]]
}

deploy() {
    FILES=( build/*.zip build/blogc-static-*.xz )
}