-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from gmacario/feat-configure-gogeniviorg
Add support for implementing a gocd agent
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# =========================================================================== | ||
# Project: gmacario/easy-build | ||
# | ||
# Run as a GoCD Agent | ||
# | ||
# Example of usage | ||
# | ||
# $ docker run -d --user=go \ | ||
# --hostname my-genivigo-testagent \ | ||
# --workdir /var/lib/go-agent \ | ||
# gmacario/build-yocto-genivi /usr/local/bin/run-gocd-agent.sh | ||
# =========================================================================== | ||
|
||
# set -x | ||
set -e | ||
|
||
# Sanity checks | ||
|
||
if [ $(whoami) != 'go' ]; then | ||
echo "Please specify docker run --user go" | ||
exit 1 | ||
fi | ||
if [ $(pwd) != '/var/lib/go-agent' ]; then | ||
echo "Please specify docker run --workdir /var/lib/go-agent" | ||
exit 1 | ||
fi | ||
if [ "${GO_SERVER}" == "" ]; then | ||
export GO_SERVER=go.genivi.org | ||
echo "GO_SERVER was not defined - setting to ${GO_SERVER}" | ||
fi | ||
|
||
git config --global user.name "easy-build" | ||
git config --global user.email "$(whoami)@$(hostname)" | ||
|
||
cp /etc/default/go-agent go-agent.ORIG | ||
sed "s/^GO_SERVER=.*$/GO_SERVER=${GO_SERVER}/g" go-agent.ORIG >/etc/default/go-agent | ||
service go-agent start | ||
|
||
# EOF |