Skip to content

Commit 204b243

Browse files
committed
Tools update for build using podman.
1 parent 00ccf24 commit 204b243

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

common.sh

+13
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,26 @@ buildsite () {
141141
grep -v "Build Warning: Layout 'content' requested in" <<< "$O"
142142
[[ -n "$f" ]] && die "Jekyll build failed!"
143143

144+
cleanup
145+
}
146+
147+
cleanup () {
148+
local Y="website/_site"
149+
local X="`getd "$Y"`"
150+
151+
scd 'website'
152+
144153
[[ -d "$X" ]] || die "'$X' does not exist!"
154+
145155
find "$X" -type f -iname '*.html' | while read z; do
146156
TMP="`ruby -ne 'BEGIN{ \$pre = false } ; x = \$_ ; \$pre = ( (x =~ /<pre/i) || (\$pre && !(x =~ /<\/pre/i) ) ) ; print unless (!\$pre && x =~ /^\s*$/)' < "$z"`"
147157

148158
echo "$TMP" > "$z"
149159
TMP=
150160
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'
151164
}
152165

153166
addmsg () {

container.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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"

display-diff.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/bash
2+
3+
git diff -w | grep -vE '^-\s*$' | grep -vE '^ ' | grep -vE '^index ' | grep -vE '^\+\+\+ ' | grep -vE '^\-\-\- ' | colordiff
4+

links.sh

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
"

0 commit comments

Comments
 (0)