uhhh pretty sure it works
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good
This commit is contained in:
parent
41045a0973
commit
51b87b720b
@ -153,7 +153,7 @@ pipeline {
|
|||||||
git commit -m \"set up for database\"
|
git commit -m \"set up for database\"
|
||||||
|
|
||||||
cp appsettings.sample.json appsettings.json
|
cp appsettings.sample.json appsettings.json
|
||||||
sed -i "s/\\"DBConnectionString\\":\\"[^\\"]*\\"/\\"DBConnectionString\\":\\"\${databaseString}\\"/g" appsettings.json
|
sed -i "s/\\"DBConnectionString\\" *: *\\"[^\\"]*\\"/\\"DBConnectionString\\":\\"\${databaseString}\\"/" appsettings.json
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@ -179,7 +179,9 @@ pipeline {
|
|||||||
certCredsId=\$(uuidgen)
|
certCredsId=\$(uuidgen)
|
||||||
|
|
||||||
ssh-keygen -t ed25519 -f "${servicename}-ssh" -N ""
|
ssh-keygen -t ed25519 -f "${servicename}-ssh" -N ""
|
||||||
privatekeycontent=\$(cat ${servicename}-ssh)
|
privatekeycontent=\$(cat ${servicename}-ssh)\$'\\n'
|
||||||
|
privatekeycontent="\$privatekeycontent
|
||||||
|
"
|
||||||
echo "private key content: \$privatekeycontent hopefully newline isn't the issue."
|
echo "private key content: \$privatekeycontent hopefully newline isn't the issue."
|
||||||
pubkeycontent=\$(cat ${servicename}-ssh.pub)
|
pubkeycontent=\$(cat ${servicename}-ssh.pub)
|
||||||
CRUMB=\$(curl -s 'http://${env.JENKINS_USR}:${env.JENKINS_PSW}@alloces.lan:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)')
|
CRUMB=\$(curl -s 'http://${env.JENKINS_USR}:${env.JENKINS_PSW}@alloces.lan:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)')
|
||||||
@ -194,8 +196,7 @@ pipeline {
|
|||||||
"password": "",
|
"password": "",
|
||||||
"privateKeySource": {
|
"privateKeySource": {
|
||||||
"stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey\$DirectEntryPrivateKeySource",
|
"stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey\$DirectEntryPrivateKeySource",
|
||||||
"privateKey": "\$privatekeycontent
|
"privateKey": "\$privatekeycontent",
|
||||||
",
|
|
||||||
},
|
},
|
||||||
"description": "${servicename}",
|
"description": "${servicename}",
|
||||||
"stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey"
|
"stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey"
|
||||||
@ -272,12 +273,9 @@ pipeline {
|
|||||||
stage("initial service setup"){
|
stage("initial service setup"){
|
||||||
steps{
|
steps{
|
||||||
sh """#!/bin/bash
|
sh """#!/bin/bash
|
||||||
pushd ${servicename}
|
ssh -i "${servicename}-ssh" -tt ${servicename}@${targetHost} "mkdir -p ~/dist"
|
||||||
scp -i \"${servicename}-ssh\" appsettings.json ${servicename}@${targetHost}:dist/appsettings.json
|
scp -i "${servicename}-ssh" ${servicename}/appsettings.json ${servicename}@${targetHost}:~/dist/appsettings.json
|
||||||
popd
|
|
||||||
"""
|
|
||||||
|
|
||||||
sh """#!/bin/bash
|
|
||||||
ssh -i "${servicename}-ssh" -tt ${servicename}@${targetHost} "mkdir -p ~/.config/systemd/user/"
|
ssh -i "${servicename}-ssh" -tt ${servicename}@${targetHost} "mkdir -p ~/.config/systemd/user/"
|
||||||
scp -i "${servicename}-ssh" ${servicename}/${servicename}.service ${servicename}@${targetHost}:~/.config/systemd/user/${servicename}.service
|
scp -i "${servicename}-ssh" ${servicename}/${servicename}.service ${servicename}@${targetHost}:~/.config/systemd/user/${servicename}.service
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user