File tree 4 files changed +89
-0
lines changed
4 files changed +89
-0
lines changed Original file line number Diff line number Diff line change @@ -141,13 +141,26 @@ buildsite () {
141
141
grep -v " Build Warning: Layout 'content' requested in" <<< " $O"
142
142
[[ -n " $f " ]] && die " Jekyll build failed!"
143
143
144
+ cleanup
145
+ }
146
+
147
+ cleanup () {
148
+ local Y=" website/_site"
149
+ local X=" ` getd " $Y " ` "
150
+
151
+ scd ' website'
152
+
144
153
[[ -d " $X " ]] || die " '$X ' does not exist!"
154
+
145
155
find " $X " -type f -iname ' *.html' | while read z; do
146
156
TMP=" ` ruby -ne ' BEGIN{ \$pre = false } ; x = \$_ ; \$pre = ( (x =~ /<pre/i) || (\$pre && !(x =~ /<\/pre/i) ) ) ; print unless (!\$pre && x =~ /^\s*$/)' < " $z " ` "
147
157
148
158
echo " $TMP " > " $z "
149
159
TMP=
150
160
done
161
+
162
+ # Fixup urls
163
+ grep -r ' http://0\.0\.0\.0:4000/' " $X " -l | xargs -n1 sed -i ' s|http://0\.0\.0\.0\:4000|https://developer.fedoraproject.org|g'
151
164
}
152
165
153
166
addmsg () {
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # ./commit.sh [common]
4
+ # Prepare staging branch for release.
5
+ # Does only local changes.
6
+ # For common options, see './common.sh -h'.
7
+ #
8
+
9
+ . $( dirname " ` readlink -e " $0 " ` " ) /common.sh || exit 1
10
+
11
+ MSG=' Content & Website update\n'
12
+
13
+ scd " website"
14
+
15
+ # container run
16
+ vrun ' docker run -it --rm -p4000:4000 -v $PWD:/opt/developerportal/website:Z pvalena/developer-portal'
17
+
18
+ vrun ' echo > _includes/announcement.html'
19
+
20
+ # container copy
21
+ vrun ' podman container cp "`podman ps -lq`:/opt/developerportal/website/_site/" .'
22
+
23
+ cleanup
24
+
25
+ prepgit master
26
+
27
+ vrun ' podman stop -l'
28
+
29
+ logg " Done\n"
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/bash
2
+
3
+ git diff -w | grep -vE ' ^-\s*$' | grep -vE ' ^ ' | grep -vE ' ^index ' | grep -vE ' ^\+\+\+ ' | grep -vE ' ^\-\-\- ' | colordiff
4
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # ./links.sh [common] [-s]
4
+ # Git diff to links.
5
+ # Does not do any changes.
6
+ # For common options, see './common.sh -h'.
7
+ #
8
+ # -s output for staging server
9
+ #
10
+
11
+ . $( dirname " ` readlink -e " $0 " ` " ) /common.sh & > /dev/null || exit 1
12
+
13
+ U1=' https://developer.'
14
+ U2=' fedoraproject.org/'
15
+
16
+ stg=
17
+ ind=
18
+ c=0
19
+ br=release
20
+
21
+ [[ " $1 " == ' -s' ]] && { stg=' stg.' ; ind=' ' ; shift ; }
22
+
23
+ [[ -n " $1 " ]] || die " Commit missing"
24
+
25
+ URL=" $U1$stg$U2 "
26
+
27
+ scd " website/content"
28
+
29
+ set -o pipefail
30
+
31
+ git diff --stat " $1 " \
32
+ | head -n -1 \
33
+ | sed -e ' s/^[\. ]*//g' \
34
+ | cut -d' ' -f1 \
35
+ | xargs -i bash -c "
36
+ f='{}'
37
+ [[ -r \"\$ f\" ]] || \
38
+ f=\"\$ ( find -name \"\$ (basename \"\$ f\" )\" | grep \"\$ f$\" | head -1 | cut -d'/' -f2- )\"
39
+ [[ -r \"\$ f\" ]] || exit 255
40
+
41
+ f=\"\$ (rev <<< \"\$ f\" | cut -d'.' -f2- | rev)\"
42
+ echo \" ${URL} \$ {f}.html\"
43
+ "
You can’t perform that action at this time.
0 commit comments