From 24a9cf706f92e4fee987ba56287a356c7a718a97 Mon Sep 17 00:00:00 2001 From: Jan-Simon Möller Date: Tue, 21 May 2019 14:18:08 +0200 Subject: Remove old doc update job and remove old content from new job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Delete the old multiversion job and also make the new job remove old content. Change-Id: I729c44723ad0063bea9614e9c9a0e6d2bb163d6f Bug-AGL: SPEC-2419 Signed-off-by: Jan-Simon Möller --- jjb/daily-jjb-doc-multiversion-update/setupdocs.sh | 143 --------------------- 1 file changed, 143 deletions(-) delete mode 100755 jjb/daily-jjb-doc-multiversion-update/setupdocs.sh (limited to 'jjb/daily-jjb-doc-multiversion-update/setupdocs.sh') diff --git a/jjb/daily-jjb-doc-multiversion-update/setupdocs.sh b/jjb/daily-jjb-doc-multiversion-update/setupdocs.sh deleted file mode 100755 index dc276b69..00000000 --- a/jjb/daily-jjb-doc-multiversion-update/setupdocs.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash - -DEBUG=1 -PROGNAME=$(basename $BASH_SOURCE) -DESTINATION="." -GITREF="" -DOCTOOLSDIR="doctools" -docswebtemplates="https://github.com/automotive-grade-linux/docs-webtemplate.git" -doctools="https://github.com/automotive-grade-linux/docs-tools.git" - -#default branch -ref_docswebtemplate="" -ref_doctools="master" - -pushd() { - command pushd "$@" &> /dev/null -} -popd() { - command popd "$@" &> /dev/null -} -debug() { - [[ $DEBUG -eq 0 ]] && echo "[DEBUG]: $@" >&2 -} -error() { - echo "$@" >&2 -} - -gitcheckout() { - command git checkout "$@" &> /dev/null - if [ ! $? -eq 0 ]; then - error "Cannot checkout: $@ does not exit" - exit 4 - fi -} - -gitclone() { - command git clone "$@" &> /dev/null - if [ ! $? -eq 0 ]; then - error "Cannot clone $@ " - exit 5 - fi -} - -function usage() { - cat <&2 -Usage: $PROGNAME [OPTIONS]... [DIRECTORY] - --debug debug mode - -d, --directory=[DST] directory destination; DST is the destination - -h, --help print this help - -t, --doctools-ref=[REFERENCE] doctools reference; - REFERENCE can be a branch, a tag, a commit - -w, --webtemplate-ref=[REFERENCE] webtemplates reference; - REFERENCE can be a branch, a tag, a commit -EOF - exit 1 -} - - -SHORTOPTS="w:t:d:h" -LONGOPTS="webtemplate-ref:,doctools-ref:,directory:,debug,help" -ARGS=$(getopt -s bash --options $SHORTOPTS \ - --longoptions $LONGOPTS --name $PROGNAME -- "$@" ) -if [ ! $? -eq 0 ]; then - exit 1 -fi -eval set -- "$ARGS" - -while [ "$#" -gt "1" ]; do - case "$1" in - -w|--webtemplate-ref) - ref_docswebtemplate=$2;shift 2;; - -t|--doctools-ref) - ref_doctools=$2; shift 2;; - -d|--directory) - DESTINATION=$2;shift 2;; - --debug) - DEBUG=0;shift 2;; - -h|--help) - usage;; - *) - usage;; - esac -done - -#make sure nodejs and jekyll are installed -node -v && jekyll -v -if [ ! $? -eq 0 ]; then - error "please, make sure nodejs and jekyll are installed" - exit 3 -fi - -#check writable dir -if [ ! -w $DESTINATION ]; then - error "$DESTINATION is not a writable directory" - exit 2 -fi - - -pushd $DESTINATION - -#get reference -[[ -d .git ]] && [[ "$(realpath $BASH_SOURCE)" == "$(realpath $(basename $BASH_SOURCE))" ]] && GITREF=$(git rev-parse HEAD) -ref_docswebtemplate=${ref_docswebtemplate:-${GITREF:-master}} -debug "ref_docswebtemplate=$ref_docswebtemplate ref_doctools=$ref_doctools" - -[[ -d .git ]] && rev=$(git show-ref -s $ref_docswebtemplate | sort | uniq) && rev=${rev:-$ref_docswebtemplate} - -debug "GITREF=$GITREF and rev=$rev" -#check that reference given matching with local repo -[[ "$GITREF" != "$rev" ]] \ - && { error "Invalid reference between $ref_docswebtemplate and local repo in $DESTINATION"; exit 5; } -#processing cloning or update -if [ -z $GITREF ]; then - echo "Cloning docwebtemplates and doctools in $DESTINATION" - gitclone $docswebtemplates . - gitcheckout $ref_docswebtemplate - gitclone $doctools $DOCTOOLSDIR - pushd $DOCTOOLSDIR - gitcheckout $ref_doctools - npm install - popd - echo "docwebtemplates and doctools cloned in $DESTINATION" -else - echo "you are in docs-webtemplate: process $DOCTOOLSDIR" - echo "so no process will be done in docs-webtemplate" - if [ -d $DOCTOOLSDIR ]; then - echo "$DOCTOOLSDIR already exits: process update with reference=$ref_doctools" - pushd $DOCTOOLSDIR - gitcheckout $branch_doctools - git pull $doctools $branch_doctools &> /dev/null - npm install - popd - else - echo "cloning $DOCTOOLSDIR" - gitclone $doctools $DOCTOOLSDIR - pushd $DOCTOOLSDIR - gitcheckout $ref_doctools - npm install - popd - fi - echo "doctools updated" -fi -popd -- cgit 1.2.3-korg