From 3b618d07d56d485fe5e200efe8f6424a135057df Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 16 Nov 2024 22:50:41 -0500 Subject: [PATCH] project 1click service is approaching --- scripts/1clickservice.groovy | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 scripts/1clickservice.groovy diff --git a/scripts/1clickservice.groovy b/scripts/1clickservice.groovy new file mode 100644 index 0000000..ad9de03 --- /dev/null +++ b/scripts/1clickservice.groovy @@ -0,0 +1,43 @@ +pipeline { + agent any + parameters { + string(name: 'svcname', description: "service name") + string(name: 'svcdesc', description: "service description") + } + stages { + stage("type strengthening") { + steps { + script { + if (svcname.isEmpty()) { + error("svcname mandatory") + } + } + } + } + stage("gitea project"){ + steps{ + script { + //TODO: clone _template-service + } + } + } + stage("service account"){ + steps{ + script { + ssh user@host username=$svcname svcpw=$ARG2 'echo "rootpass" | sudo -Sv && bash -s' << 'ENDSSH' + #commands to run on remote host + useradd -m -s /bin/bash $username + echo "$username:$password" | chpasswd + ENDSSH + } + } + } + stage("initial service setup"){ + steps{ + script { + //TODO + } + } + } + } +} \ No newline at end of file