From a1f34001696c44139b668918ea52c1add0dde7ea Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Mon, 1 Jun 2020 22:14:26 +0200 Subject: fixed include system, updated some tasks --- tasks/apt-update | 23 ----------------------- tasks/initial-user-setup | 2 +- tasks/jenkins | 26 ++++++++++++++++++++++++++ tasks/system-update | 31 +++++++++++++++++++++++++++++++ tasks/update | 23 ----------------------- 5 files changed, 58 insertions(+), 47 deletions(-) delete mode 100644 tasks/apt-update create mode 100644 tasks/jenkins create mode 100644 tasks/system-update delete mode 100644 tasks/update (limited to 'tasks') diff --git a/tasks/apt-update b/tasks/apt-update deleted file mode 100644 index 38693b3..0000000 --- a/tasks/apt-update +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -function task_exec() { - sudo apt-get -y update - sudo apt-get -y upgrade -} - -function task_setup() { - # Available environment variables - # $ASSET_DIR - # $TOOL_DIR - - SSH_USER=server - SSH_IDENTITY_FILE=$ASSET_DIR/id_rsa - - TASK_ISSET="yes" -} - -if [ -z $HOSTMODE ]; then - task_exec -else - task_setup -fi diff --git a/tasks/initial-user-setup b/tasks/initial-user-setup index de3aee9..68a0d2a 100644 --- a/tasks/initial-user-setup +++ b/tasks/initial-user-setup @@ -5,7 +5,7 @@ function task_setup() { SSH_IDENTITY_FILE=$ASSET_DIR/id_jenkins FILES+=("$ASSET_DIR/id_user.pub" "$ASSET_DIR/id_jenkins.pub") - INCLUDES+=("pkgmanager") + INCLUDES+=("$INCLUDE_DIR/pkgmanager") TASK_ISSET="yes" } diff --git a/tasks/jenkins b/tasks/jenkins new file mode 100644 index 0000000..5598a9e --- /dev/null +++ b/tasks/jenkins @@ -0,0 +1,26 @@ +#!/bin/bash + +function task_exec() { + + cat id_jenkins.pub >> /home/server/.ssh/authorized_keys + +} + +function task_setup() { + # Available environment variables + # $ASSET_DIR + # $TOOL_DIR + + SSH_USER=server + SSH_IDENTITY_FILE=$ASSET_DIR/id_jenkins + + FILES+=("$ASSET_DIR/id_jenkins.pub") + + TASK_ISSET="yes" +} + +if [ -z $HOSTMODE ]; then + task_exec +else + task_setup +fi diff --git a/tasks/system-update b/tasks/system-update new file mode 100644 index 0000000..8244ca4 --- /dev/null +++ b/tasks/system-update @@ -0,0 +1,31 @@ +#!/bin/bash + +function task_exec() { + ret=0 + sudo pkg_update + ret=$(($ret + $?)) + + sudo pkg_upgrade + ret=$(($ret + $?)) + + exit $ret +} + +function task_setup() { + # Available environment variables + # $ASSET_DIR + # $TOOL_DIR + + INCLUDES+=("$INCLUDE_DIR/pkgmanager") + + SSH_USER=server + SSH_IDENTITY_FILE=$ASSET_DIR/id_jenkins + + TASK_ISSET="yes" +} + +if [ -z $HOSTMODE ]; then + task_exec +else + task_setup +fi diff --git a/tasks/update b/tasks/update deleted file mode 100644 index e392b76..0000000 --- a/tasks/update +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -function task_exec() { - pkg_update - pkg_upgrade -} - -function task_setup() { - INCLUDES+=("$INCLUDE_DIR/pkgmanager") - - SSH_USER=server - #SSH_IDENTITY_FILE=$ASSET_DIR/id_rsa - - FILES+=() - - TASK_ISSET="yes" -} - -if [ -z $HOSTMODE ]; then - task_exec -else - task_setup -fi -- cgit v1.2.3