project 1click service is approaching
This commit is contained in:
parent
fc56ddda34
commit
3b618d07d5
43
scripts/1clickservice.groovy
Normal file
43
scripts/1clickservice.groovy
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user