Add Python flask app from external repository

Step 1 - Create custom recipe

In order to install python flask app on yocto image you have to create custom recipe which will pull files from external repository and install them in appropriate location.

mkdir -p ../meta-golemos/recipes-base/datalogger-setup-page
touch ../meta-golemos/recipes-base/datalogger-setup-page/datalogger-setup-page.bb

Inside this file you need to place this instructions.

SUMMARY = "datalogger-setup-page recipe"
DESCRIPTION = "Recipe to add datalogger-setup-page to it's location."
LICENSE = "CLOSED"

inherit allarch perlnative

DEPENDS += " perl"

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += " \
    git://git@gitlab.sclabs.io:10122/datalogger/setup-page.git;protocol=ssh; \
"
SRCREV = "${AUTOREV}"

S = "${WORKDIR}/git"

DESTINATION = "/var/www/datalogger-setup.local"

do_install () {
    install -d ${D}${DESTINATION}
    cp -r ${S}/* ${D}${DESTINATION}
}

FILES_${PN} += "${DESTINATION}"

RDEPENDS_${PN} += " perl"

Note

AUTOREV variable is used here to always pull latest revision of software. You can also write here specific commit hash and pull this commit every time.

Step 2 - Add recipe to package group

In order to make this recipe work you have to add it to the proper package group. If you feel that this package is ready you can add it to the base package group, if not place it in development section.

Summary

After only this two steps your layer structure should be updated to this moment.

../meta-golemos
├── COPYING.MIT
├── README
├── conf
│   ├── bblayers.conf.sample
│   ├── conf-notes.txt
│   ├── distro
│   │   └── golemos.conf
│   ├── layer.conf
│   └── local.conf.sample
├── recipes-base
│   └── datalogger-setup-page
│       └── datalogger-setup-page.bb
├── recipes-connectivity
│   ├── hostapd
│   │   ├── files
│   │   │   ├── hostapd@.service
│   │   │   └── wlan0.conf
│   │   └── hostapd_%.bbappend
│   ├── kea
│   │   ├── files
│   │   │   ├── kea-dhcp4.conf
│   │   │   └── kea-dhcp4.service
│   │   └── kea_%.bbappend
│   └── wpa-supplicant
│       ├── files
│       │   └── wpa_supplicant-nl80211-wlan0.conf
│       └── wpa-supplicant_%.bbappend
├── recipes-core
│   ├── images
│   │   ├── datalogger-dev-image.bb
│   │   ├── datalogger-extended-image.bb
│   │   └── datalogger-image.bb
│   ├── packagegroups
│   │   ├── datalogger-base-packagegroup.bb
│   │   ├── datalogger-core-packagegroup.bb
│   │   ├── datalogger-dev-packagegroup.bb
│   │   └── datalogger-extended-packagegroup.bb
│   ├── systemd
│   │   └── systemd_%.bbappend
│   └── systemd-conf
│       ├── files
│       │   └── wlan.network
│       └── systemd-conf_%.bbappend
└── recipes-example
    └── example
        └── example_0.1.bb