test -n "$PROJECT_FILE" || die "Missing argument: project_file"
head -n 1 "${PROJECT_FILE}" | tr -d '\n'
}
+
+update_db() {
+ SR="$1"
+ TAG="$2"
+ BUILD_NR="$3"
+ TARGET="$4"
+ test -n "$SR" || die "Missing argument: sr"
+ test -n "$TAG" || die "Missing argument: tag"
+ test -n "$BUILD_NR" || die "Missing argument: build_nr"
+ test -n "$TARGET" || die "Missing argument: target"
+ lockfile-create --use-pid "${DBPATH}"
+ sqlite3 "${DBPATH}" "insert into test values (NULL,'$SR', CURRENT_TIMESTAMP, $BUILD_NR,\
+ (select r.rid from result r where r.rname='$TAG'),\
+ (select d.did from device d where d.dname='$TARGET'));"
+ lockfile-remove "${DBPATH}"
+}
echo "TARGET: $TARGET"
# Publish to database
-sqlite3 "${DBPATH}" "insert into test values (NULL,'$SR', CURRENT_TIMESTAMP, $BUILD_NR,\
- (select r.rid from result r where r.rname='$AVOCADO_TAG'),\
- (select d.did from device d where d.dname='$TARGET'));"
+update_db "$SR" "$AVOCADO_TAG" "$BUILD_NR" "$TARGET"
# Publish to www
{