Skip to content

Commit 978121f

Browse files
committed
Merge pull request #207 from gmacario/feat-configure-gogeniviorg
Add support for implementing a gocd agent
2 parents 97090fe + b687a67 commit 978121f

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

build-yocto-genivi/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ RUN id build >/dev/null || useradd --create-home --shell /bin/bash build
6666

6767
RUN mkdir -p /usr/local/bin
6868
COPY clone-and-build-gdp.sh /usr/local/bin/
69+
COPY run-gocd-agent.sh /usr/local/bin/
6970
RUN dos2unix /usr/local/bin/*.sh && chmod 755 /usr/local/bin/*.sh
7071

7172
# Expose sshd port

build-yocto-genivi/run-gocd-agent.sh

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

0 commit comments

Comments
 (0)