File bin/build.sh
Last commit: Tue Dec 24 13:11:32 2024 +0100 Jan Dankert New: Overriding the reposity name using the project name. A new setting for the title is called project.title
1 #!/bin/bash 2 3 echo 4 echo "--- Prepare ---" 5 6 if is_on ${debug}; then echo "Debug is enabled"; fi 7 8 PRJCONFFILE=$(mktemp) 9 git archive HEAD ${project_config_file}|tar xO > $PRJCONFFILE 10 if [ $? -eq 0 ]; then 11 echo "Reading per project config '${project_config_file}' from '$PRJCONFFILE'" 12 13 if is_on ${debug}; then 14 echo $PRJCONFFILE 15 echo "Content of '${project_config_file}':" 16 echo $(parse_yaml $PRJCONFFILE "repo_") 17 fi; 18 eval $(parse_yaml $PRJCONFFILE "repo_") 19 else 20 echo "No file $project_config_file found - ignoring..." 21 fi 22 rm $PRJCONFFILE 23 24 if is_on ${debug}; then 25 set | grep -i "^repo" 26 fi; 27 28 REPO=${PWD} 29 echo "Repository directory: $REPO" 30 # GIT has no specific repository name, so we are using the directory name 31 REPO_NAME="$(basename $REPO| cut -d'.' -f1)" 32 echo "Repository bare name: $REPO_NAME" 33 # ... but it is possible to overwrite it 34 if [ -n "$repo_project_name" ]; then REPO_NAME=$repo_project_name; fi 35 # clear unwanted chars for safe file operations 36 REPO_NAME="$(echo -n $REPO_NAME| tr '[:upper:]' '[:lower:]'|tr -c '[:alnum:]' '-')" 37 38 # Fallback values for repo information... 39 if [ -z "$repo_project_title" ]; then repo_project_title=$REPO_NAME; fi 40 if [ -z "$repo_project_description" ]; then repo_project_description="" ; fi 41 if [ -z "$repo_project_author" ]; then repo_project_author=$(git log -1 --pretty=format:'%an') ; fi 42 if [ -z "$repo_project_email" ]; then repo_project_author=$(git log -1 --pretty=format:'%ae') ; fi 43 44 echo "Repository name : $REPO_NAME" 45 echo "Repository title : $repo_project_title" 46 echo "Repository descr. : $repo_project_description" 47 echo "Repository author : $repo_project_author" 48 echo "Repository email : $repo_project_email" 49 echo 50 echo "----------------------------------------------------------------------------" 51 echo "BUILDING $REPO_NAME" 52 echo "----------------------------------------------------------------------------" 53 echo "Starting at: $(date -R)" 54 echo "Project home: $REPO" 55 echo "----------------------------------------------------------------------------" 56 57 58 # if git commits are present 59 if [ $(git rev-list --count --all) != "0" ]; then 60 LAST_COMMIT_USER=$(git log -n 1 --pretty=format:%an) 61 LAST_COMMIT_EMAIL=$(git log -n 1 --pretty=format:%ae) 62 LAST_COMMIT_MESSAGE=$(git log -n 1 --pretty=format:%B) 63 LAST_COMMIT_DATE=$(git log -n 1 --pretty=format:%cD) 64 fi 65 66 USER_NAME=$(git config --get user.name) 67 USER_EMAIL=$(git config --get user.email) 68 69 source ${DIT_DIR}/bin/modules.sh 70 71 if [ $? -eq 0 ]; then 72 STATUS="SUCCESS" 73 else 74 STATUS="FAILED" 75 fi 76 77 echo 78 echo "----------------------------------------------------------------------------" 79 echo "BUILD $STATUS" 80 echo "----------------------------------------------------------------------------" 81 echo 82 echo "Finished at: $(date -R)" 83 echo "Powered by DIT $(dirname $0)" 84 echo "----------------------------------------------------------------------------"
Downloadbin/build.sh
History Tue, 24 Dec 2024 13:11:32 +0100 Jan Dankert New: Overriding the reposity name using the project name. A new setting for the title is called project.title 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