@@ -43,11 +43,14 @@ Options:
4343 default branch automatically, with no 'main' stub
4444 --gitlab after pushing, set the GitLab project up the way
4545 every SMS++ module is: protect 'develop' and
46- 'master' and copy the CI/CD variables (the Gurobi
47- WLS license and the deploy key the CI needs) from
48- --reference. Needs the 'glab' CLI, authenticated
49- with a Maintainer of both projects. Given alone, in
50- a checkout of an existing module, it does only this
46+ 'master', give it the description of --desc, ending
47+ with a full stop as every other one does, and copy
48+ the CI/CD variables (the Gurobi WLS license and the
49+ deploy key the CI needs) from --reference. Needs the
50+ 'glab' CLI, authenticated with a Maintainer of both
51+ projects. Given alone, in a checkout of an existing
52+ module, it does only this, taking the description
53+ already there if --desc is not given
5154 --reference <path> project the CI/CD variables are copied from
5255 (default: smspp/binaryknapsackblock)
5356 --umbrella <path> path to a checkout of the SMS++ umbrella project:
@@ -96,6 +99,26 @@ gitlab_setup() {
9699 fi
97100 done
98101
102+ # the description of the project, i.e. what the GitLab project page shows
103+ # under its name: it is the one of --desc, or the one already there when
104+ # this is run on an existing module, and it ends with a full stop, as the
105+ # description of every SMS++ module does
106+ local description
107+ description=${DESC:- $( glab api " projects/$encoded " |
108+ python3 -c ' import json,sys; print( json.load( sys.stdin )[ "description" ]
109+ or "" )' )}
110+
111+ if [ -n " $description " ]; then
112+ case " $description " in * . ) ;; * ) description=" $description ." ;; esac
113+
114+ if glab api --method PUT " projects/$encoded " \
115+ --raw-field " description=$description " > /dev/null 2>&1 ; then
116+ echo " described as \" $description \" "
117+ else
118+ echo " could not set the description"
119+ fi
120+ fi
121+
99122 # the variables are read one at a time, so that no secret is ever written
100123 # anywhere but into the API call that carries it
101124 local keys key value protected masked raw
0 commit comments