File bin/build.sh

Last commit: Sun Dec 8 22:53:24 2024 +0100	Jan Dankert	Fix: Support for bare repositories.
1 #!/bin/bash 2 3 REPO=${PWD} 4 REPO_NAME="$(basename $REPO| cut -d'.' -f1)" 5 6 # Fallback values for repo name and description. 7 if [ -z $repo_project_name ]; then repo_project_name=$REPO_NAME; fi 8 if [ -z $repo_project_description ]; then repo_project_description="" ; fi 9 if [ -z $repo_project_author ]; then repo_project_author=$(git log -1 --pretty=format:'%an') ; fi 10 if [ -z $repo_project_email ]; then repo_project_author=$(git log -1 --pretty=format:'%ae') ; fi 11 12 echo 13 echo "----------------------------------------------------------------------------" 14 echo "BUILDING $REPO_NAME" 15 echo "----------------------------------------------------------------------------" 16 echo "Starting at: $(date -R)" 17 echo "Project home: $REPO" 18 echo "----------------------------------------------------------------------------" 19 20 echo 21 echo "--- Prepare ---" 22 23 if is_on ${debug}; then echo "Debug is enabled"; fi 24 25 # if git commits are present 26 if [ $(git rev-list --count --all) != "0" ]; then 27 LAST_COMMIT_USER=$(git log -n 1 --pretty=format:%an) 28 LAST_COMMIT_EMAIL=$(git log -n 1 --pretty=format:%ae) 29 LAST_COMMIT_MESSAGE=$(git log -n 1 --pretty=format:%B) 30 LAST_COMMIT_DATE=$(git log -n 1 --pretty=format:%cD) 31 fi 32 33 USER_NAME=$(git config --get user.name) 34 USER_EMAIL=$(git config --get user.email) 35 36 37 # echo parse_yaml $project_config_file; 38 #end; 39 PRJCONFFILE=$(mktemp) 40 git archive HEAD ${project_config_file}|tar xO > $PRJCONFFILE 41 if [ $? -eq 0 ]; then 42 echo "reading per project config '${project_config_file}' from '$PRJCONFFILE'" 43 44 if is_on ${debug}; then 45 echo $PRJCONFFILE 46 echo "" 47 echo $(parse_yaml $PRJCONFFILE "repo_") 48 fi; 49 eval $(parse_yaml $PRJCONFFILE "repo_") 50 else 51 echo "No file $project_config_file found - ignoring..." 52 fi 53 rm $PRJCONFFILE 54 55 if is_on ${debug}; then 56 set | grep -i "^repo" 57 fi; 58 59 source ${DIT_DIR}/bin/modules.sh 60 61 if [ $? -eq 0 ]; then 62 STATUS="SUCCESS" 63 else 64 STATUS="FAILED" 65 fi 66 67 echo 68 echo "----------------------------------------------------------------------------" 69 echo "BUILD $STATUS" 70 echo "----------------------------------------------------------------------------" 71 echo 72 echo "Finished at: $(date -R)" 73 echo "Powered by DIT $(dirname $0)" 74 echo "----------------------------------------------------------------------------"
Download bin/build.sh
History Sun, 8 Dec 2024 22:53:24 +0100 Jan Dankert Fix: Support for bare repositories. Sun, 8 Dec 2024 22:41:59 +0100 Jan Dankert Fix: Checking for per project module config Sun, 8 Dec 2024 22:33:23 +0100 Jan Dankert Modules can be disabled by project configuration Sun, 8 Dec 2024 22:02:04 +0100 Jan Dankert Fix: Support for bare repositories. Sun, 8 Dec 2024 22:00:02 +0100 Jan Dankert Fix: Support for bare repositories. Wed, 27 Nov 2024 01:04:22 +0100 Jan Dankert Small fixes... Tue, 26 Nov 2024 23:26:36 +0100 Jan Dankert New: Creating a project website