aboutsummaryrefslogtreecommitdiffstats
path: root/ci.d/buildkite
diff options
context:
space:
mode:
Diffstat (limited to 'ci.d/buildkite')
-rw-r--r--ci.d/buildkite19
1 files changed, 9 insertions, 10 deletions
diff --git a/ci.d/buildkite b/ci.d/buildkite
index 21988f8..670fa0c 100644
--- a/ci.d/buildkite
+++ b/ci.d/buildkite
@@ -1,12 +1,10 @@
#!/usr/bin/env sh
_buildkite_config() {
- BUILDKITE_PATH=/root/.buildkite-agent
- BUILDKITE_USER=root
+ BUILDKITE_PATH=/home/buildkite-agent/.buildkite-agent
if [ "$1" = 'ubuntu' -o "$1" = 'debian' -o "$1" = 'centos' ]
then
BUILDKITE_PATH=/etc/buildkite-agent
- BUILDKITE_USER=buildkite-agent
fi
# Update the configuration.
lxc_do bash -c "echo name=\"$1-%n\" >> $BUILDKITE_PATH/buildkite-agent.cfg"
@@ -19,7 +17,7 @@ _buildkite_config() {
<$( cd "$( dirname "$0" )" && pwd )/priv/buildkite-pre-artifact-hook \
lxc_do bash -c "cat > $BUILDKITE_PATH/hooks/pre-artifact"
lxc_do chmod +x $BUILDKITE_PATH/hooks/pre-artifact
- lxc_do chown $BUILDKITE_USER:$BUILDKITE_USER $BUILDKITE_PATH/hooks/pre-artifact
+ lxc_do chown buildkite-agent:buildkite-agent $BUILDKITE_PATH/hooks/pre-artifact
}
_buildkite_install_centos() {
@@ -30,12 +28,13 @@ _buildkite_install_centos() {
}
_buildkite_install_generic() {
- lxc_do curl -sLO https://raw.githubusercontent.com/buildkite/agent/master/install.sh
- lxc_do bash -c "TOKEN=\"$2\" bash install.sh"
- lxc_do rm install.sh
- lxc_do bash -c 'echo "@reboot /root/.buildkite-agent/bin/buildkite-agent start &" >> tmpcron'
- lxc_do crontab tmpcron
- lxc_do rm tmpcron
+ lxc_do useradd -m -s /bin/bash buildkite-agent
+ lxc_do su - buildkite-agent -c 'curl -sLO https://raw.githubusercontent.com/buildkite/agent/master/install.sh'
+ lxc_do su - buildkite-agent -c "TOKEN=\"$2\" bash install.sh"
+ lxc_do su - buildkite-agent -c 'rm install.sh'
+ lxc_do su - buildkite-agent -c 'echo "@reboot /home/buildkite-agent/.buildkite-agent/bin/buildkite-agent start &" >> tmpcron'
+ lxc_do su - buildkite-agent -c 'crontab tmpcron'
+ lxc_do su - buildkite-agent -c 'rm tmpcron'
}
_buildkite_install_ubuntu() {