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