File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ RUN id build >/dev/null || useradd --create-home --shell /bin/bash build
6666
6767RUN mkdir -p /usr/local/bin
6868COPY clone-and-build-gdp.sh /usr/local/bin/
69+ COPY run-gocd-agent.sh /usr/local/bin/
6970RUN dos2unix /usr/local/bin/*.sh && chmod 755 /usr/local/bin/*.sh
7071
7172# Expose sshd port
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # ===========================================================================
4+ # Project: gmacario/easy-build
5+ #
6+ # Run as a GoCD Agent
7+ #
8+ # Example of usage
9+ #
10+ # $ docker run -d --user=go \
11+ # --hostname my-genivigo-testagent \
12+ # --workdir /var/lib/go-agent \
13+ # gmacario/build-yocto-genivi /usr/local/bin/run-gocd-agent.sh
14+ # ===========================================================================
15+
16+ # set -x
17+ set -e
18+
19+ # Sanity checks
20+
21+ if [ $( whoami) != ' go' ]; then
22+ echo " Please specify docker run --user go"
23+ exit 1
24+ fi
25+ if [ $( pwd) != ' /var/lib/go-agent' ]; then
26+ echo " Please specify docker run --workdir /var/lib/go-agent"
27+ exit 1
28+ fi
29+ if [ " ${GO_SERVER} " == " " ]; then
30+ export GO_SERVER=go.genivi.org
31+ echo " GO_SERVER was not defined - setting to ${GO_SERVER} "
32+ fi
33+
34+ git config --global user.name " easy-build"
35+ git config --global user.email " $( whoami) @$( hostname) "
36+
37+ cp /etc/default/go-agent go-agent.ORIG
38+ sed " s/^GO_SERVER=.*$/GO_SERVER=${GO_SERVER} /g" go-agent.ORIG > /etc/default/go-agent
39+ service go-agent start
40+
41+ # EOF
You can’t perform that action at this time.
0 commit comments