File tree 6 files changed +44
-5
lines changed
6 files changed +44
-5
lines changed Original file line number Diff line number Diff line change
1
+ .git
Original file line number Diff line number Diff line change
1
+ language : minimal
2
+
3
+ services :
4
+ - docker
5
+
6
+ before_install :
7
+ - docker build -t jsks/czhttpd .
8
+
9
+ script :
10
+ - docker run jsks/czhttpd make
11
+
12
+ after_success :
13
+ - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
14
+ echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
15
+ docker push jsks/czhttpd;
16
+ fi
Original file line number Diff line number Diff line change
1
+ FROM zshusers/zsh-master
2
+
3
+ RUN rm -rf /usr/share/zsh/*/scripts/newuser
4
+ RUN install_packages make
5
+
6
+ RUN groupadd czhttpd \
7
+ && useradd -m -g czhttpd -d /home/czhttpd -s /sbin/nologin czhttpd
8
+ USER czhttpd
9
+
10
+ ENV APP=/home/czhttpd/src
11
+ RUN mkdir -p $APP/modules/ $APP/test/
12
+ COPY --chown=czhttpd:czhttpd czhttpd Makefile $APP/
13
+ COPY --chown=czhttpd:czhttpd modules/ $APP/modules/
14
+ COPY --chown=czhttpd:czhttpd test/ $APP/test/
15
+
16
+ WORKDIR $APP
17
+ RUN make clean
18
+
19
+ CMD ["zsh" , "czhttpd" , "-v" ]
Original file line number Diff line number Diff line change 10
10
11
11
for i in datetime pcre stat system; zmodload zsh/$i || exit 127
12
12
13
- setopt err_return rematch_pcre
13
+ setopt rematch_pcre
14
14
15
15
typeset -gA STATS
16
16
STATS[count]=0
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ if [[ -t 1 ]] && (( $terminfo[colors] >= 8 )); then
9
9
colors
10
10
fi
11
11
12
- setopt err_return
13
-
14
12
which vegeta > /dev/null || error " Missing vegeta, unable to run stress tests"
15
13
16
14
typeset -g VEGETA_OPTS VERBOSE DURATION
Original file line number Diff line number Diff line change 1
1
# Utility functions/variables for testing czhttpd
2
2
# ##
3
3
4
- setopt local_options
4
+ setopt err_return local_options
5
5
6
6
typeset -g SRC_DIR TESTTMP TESTROOT CONF PORT
7
7
@@ -68,6 +68,9 @@ function reload_conf() {
68
68
}
69
69
70
70
function cleanup() {
71
+ # Return value of previous command before trap was triggered
72
+ private rv=$?
73
+
71
74
setopt noerr_return
72
75
stop_server
73
76
@@ -76,6 +79,8 @@ function cleanup() {
76
79
[[ -d " /tmp/cztest-$$ " ]] && rm -rf " /tmp/cztest-$$ "
77
80
78
81
rm -rf $SRC_DIR /.czhttpd-pid
82
+
83
+ return $rv
79
84
}
80
85
81
- trap " cleanup; exit " INT TERM KILL EXIT ZERR
86
+ trap " cleanup" INT TERM KILL EXIT
You can’t perform that action at this time.
0 commit comments