Skip to content

Commit 5c6d262

Browse files
committed
Travis CI build configuration updated to the latest version.
1 parent 31ded5a commit 5c6d262

File tree

5 files changed

+57
-51
lines changed

5 files changed

+57
-51
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dotnet: 2.2
66
before_install:
77
- sudo apt-get install -y texlive texlive-lang-cyrillic texlive-latex-extra python-pygments ghostscript
88
- export TRAVIS_REPO_NAME=$(echo "${TRAVIS_REPO_SLUG#*/}" | sed 's/.*/\u&/')
9+
- export SOURCE_BRANCH="master"
910
script:
1011
- dotnet build -c Release
1112
after_success:

format-csharp-files.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
sys.setdefaultencoding('utf-8')
66
for line in sys.stdin.readlines():
77
line = line.strip()
8-
print "\\index{%s}" % (line.replace('_','\\_'))
9-
print "\\begin{section}{%s}" % (line.replace('_','\\_'))
8+
print("\\index{%s}" % (line.replace('_','\\_')))
9+
print("\\begin{section}{%s}" % (line.replace('_','\\_')))
1010
#print "\\inputminted[tabsize=2,breaklines,linenos=true]{csharp}{%s}" % (line)
11-
print "\\begin{minted}[tabsize=2,breaklines,breakanywhere,linenos=true,xleftmargin=7mm,framesep=4mm]{csharp}"
11+
print("\\begin{minted}[tabsize=2,breaklines,breakanywhere,linenos=true,xleftmargin=7mm,framesep=4mm]{csharp}")
1212
f = open(line,"rt")
1313
c = "\n".join([x.strip("\n") for x in f.readlines()])
1414
f.close()
1515
c = c.replace(u'\ufeff','')
16-
print c
17-
print "\\end{minted}"
18-
print "\\end{section}"
19-
print
16+
print(c)
17+
print("\\end{minted}")
18+
print("\\end{section}")
19+
print("\n")

format-document.sh

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,37 @@ set -e # Exit with nonzero exit code if anything fails
44
# Download fvextra package
55
wget https://raw.githubusercontent.com/gpoore/fvextra/cc1c0c5f7b92023cfec67084e2a87bdac520414c/fvextra/fvextra.sty
66

7-
echo """
8-
\\documentclass[11pt,a4paper,fleqn]{report}
9-
\\usepackage[left=5mm,top=5mm,right=5mm,bottom=5mm]{geometry}
10-
\\textwidth=200mm
11-
\\usepackage[utf8]{inputenc}
12-
\\usepackage[T1]{fontenc}
13-
\\usepackage[T2A]{fontenc}
14-
\\usepackage{fvextra}
15-
\\usepackage{minted}
16-
\\usemintedstyle{vs}
17-
\\usepackage{makeidx}
18-
\\usepackage[columns=1]{idxlayout}
19-
\\makeindex
20-
\\renewcommand{\\thesection}{\\arabic{chapter}.\\arabic{section}}
21-
\\setcounter{chapter}{1}
22-
\\setcounter{section}{0}
23-
\\usepackage[tiny]{titlesec}
24-
\\titlespacing\\chapter{0mm}{0mm}{0mm}
25-
\\titlespacing\\section{0mm}{0mm}{0mm}
26-
\\DeclareUnicodeCharacter{221E}{\\ensuremath{\\infty}}
27-
\\DeclareUnicodeCharacter{FFFD}{\\ensuremath{ }}
28-
\\usepackage{fancyhdr}
29-
\\pagestyle{fancy}
30-
\\fancyhf{}
31-
\\fancyfoot[C]{\\thepage}
32-
\\renewcommand{\\headrulewidth}{0mm}
33-
\\renewcommand{\\footrulewidth}{0mm}
34-
\\renewcommand{\\baselinestretch}{0.7}
35-
\\begin{document}
36-
\\sf
37-
\\noindent{\\Large LinksPlatform's Platform.${TRAVIS_REPO_NAME} Class Library}
7+
printf """
8+
\\\documentclass[11pt,a4paper,fleqn]{report}
9+
\\\usepackage[left=5mm,top=5mm,right=5mm,bottom=5mm]{geometry}
10+
\\\textwidth=200mm
11+
\\\usepackage[utf8]{inputenc}
12+
\\\usepackage[T1]{fontenc}
13+
\\\usepackage[T2A]{fontenc}
14+
\\\usepackage{fvextra}
15+
\\\usepackage{minted}
16+
\\\usemintedstyle{vs}
17+
\\\usepackage{makeidx}
18+
\\\usepackage[columns=1]{idxlayout}
19+
\\\makeindex
20+
\\\renewcommand{\\\thesection}{\\\arabic{chapter}.\\\arabic{section}}
21+
\\\setcounter{chapter}{1}
22+
\\\setcounter{section}{0}
23+
\\\usepackage[tiny]{titlesec}
24+
\\\titlespacing\\\chapter{0mm}{0mm}{0mm}
25+
\\\titlespacing\\\section{0mm}{0mm}{0mm}
26+
\\\DeclareUnicodeCharacter{221E}{\\\ensuremath{\\\infty}}
27+
\\\DeclareUnicodeCharacter{FFFD}{\\\ensuremath{ }}
28+
\\\usepackage{fancyhdr}
29+
\\\pagestyle{fancy}
30+
\\\fancyhf{}
31+
\\\fancyfoot[C]{\\\thepage}
32+
\\\renewcommand{\\\headrulewidth}{0mm}
33+
\\\renewcommand{\\\footrulewidth}{0mm}
34+
\\\renewcommand{\\\baselinestretch}{0.7}
35+
\\\begin{document}
36+
\\\sf
37+
\\\noindent{\\\Large LinksPlatform's Platform.${TRAVIS_REPO_NAME} Class Library}
3838
"""
3939

4040
# Remove auto-generated code files
@@ -44,7 +44,7 @@ find ./obj -type f -iname "*.cs" -delete
4444
#find * -type f -iname '*.cs' -exec sh -c 'enconv "{}"' \;
4545
find . -type f -iname '*.cs' | sort -b | python format-csharp-files.py
4646

47-
echo """
48-
\\printindex
49-
\\end{document}
47+
printf """
48+
\\\printindex
49+
\\\end{document}
5050
"""

generate-pdf.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/bash
22
set -e # Exit with nonzero exit code if anything fails
33

4+
# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
5+
if [[ ( "$TRAVIS_PULL_REQUEST" != "false" ) || ( "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ) ]]; then
6+
echo "Skipping pdf generation."
7+
exit 0
8+
fi
9+
410
# Generate tex file
511
bash format-document.sh > document.tex
612

publish-docs.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
#!/bin/bash
22
set -e # Exit with nonzero exit code if anything fails
33

4+
# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
5+
if [[ ( "$TRAVIS_PULL_REQUEST" != "false" ) || ( "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ) ]]; then
6+
echo "Skipping documentation deploy."
7+
exit 0
8+
fi
9+
410
# Settings
5-
SOURCE_BRANCH="master"
611
TARGET_BRANCH="gh-pages"
712
SHA=$(git rev-parse --verify HEAD)
813
COMMIT_USER_NAME="linksplatform-docs"
914
COMMIT_USER_EMAIL="[email protected]"
1015
REPOSITORY="github.com/linksplatform/${TRAVIS_REPO_NAME}"
1116

12-
# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
13-
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
14-
echo "Skipping deploy."
15-
exit 0
16-
fi
17-
1817
# Insert repository name into DocFX's configuration files
1918
sed -i "s/\$TRAVIS_REPO_NAME/${TRAVIS_REPO_NAME}/g" toc.yml
2019
sed -i "s/\$TRAVIS_REPO_NAME/${TRAVIS_REPO_NAME}/g" docfx.json
2120

2221
# DocFX installation
2322
nuget install docfx.console
24-
mono $(ls | grep "docfx.console.")/tools/docfx.exe docfx.json
23+
mono $(echo ./*docfx.console.*)/tools/docfx.exe docfx.json
2524

2625
# Clone the existing gh-pages for this repo into out/
2726
# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deply)
2827
git clone https://$REPOSITORY out
29-
cd out
28+
cd out || exit
3029
git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH
3130
cd ..
3231

@@ -36,7 +35,7 @@ rm -rf out/**/* || exit 0
3635
# Copy genereted docs site
3736
cp -r _site/* out
3837

39-
cd out
38+
cd out || exit
4039

4140
# Do not use index.md
4241
cp README.html index.html

0 commit comments

Comments
 (0)