Compare commits
No commits in common. "51b87b720b9560af93baff337257d741911e8116" and "88419c8985ef334592f282f35766587262eed333" have entirely different histories.
51b87b720b
...
88419c8985
@ -128,19 +128,20 @@ pipeline {
|
|||||||
|
|
||||||
pushd ${servicename}
|
pushd ${servicename}
|
||||||
|
|
||||||
databaseString="Host=${targetHost};Database=${servicename};Username=${servicename};Password=${env.pw_productiondatabase};IncludeErrorDetail=true;"
|
|
||||||
|
|
||||||
databasecredsid=\$(uuidgen)
|
databasecredsid=\$(uuidgen)
|
||||||
httpBasicAuth=\"http://${env.JENKINS_USR}:${env.JENKINS_PSW}@alloces.lan:8080/\"
|
httpBasicAuth=\"http://${env.JENKINS_USR}:${env.JENKINS_PSW}@alloces.lan:8080/\"
|
||||||
|
echo \"\${httpBasicAuth}\"
|
||||||
urlGetData=\"crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\\":\\",//crumb)\"
|
urlGetData=\"crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\\":\\",//crumb)\"
|
||||||
|
|
||||||
CRUMB=\$(curl -s -c cookies.txt \"\${httpBasicAuth}\${urlGetData}\")
|
CRUMB=\$(curl -s -c cookies.txt \"\${httpBasicAuth}\${urlGetData}\")
|
||||||
|
echo "crumb anyway. \$CRUMB"
|
||||||
curl -H \$CRUMB -X POST \"http://${env.JENKINS_USR}:${env.JENKINS_PSW}@alloces.lan:8080/job/gitea.arg.rip/job/${servicename}/credentials/store/folder/domain/_/createCredentials\" \
|
curl -H \$CRUMB -X POST \"http://${env.JENKINS_USR}:${env.JENKINS_PSW}@alloces.lan:8080/job/gitea.arg.rip/job/${servicename}/credentials/store/folder/domain/_/createCredentials\" \
|
||||||
--data-urlencode 'json={
|
--data-urlencode 'json={
|
||||||
"": "0",
|
"": "0",
|
||||||
"credentials": {
|
"credentials": {
|
||||||
"scope": "GLOBAL",
|
"scope": "GLOBAL",
|
||||||
"id": "'"\$databasecredsid"'",
|
"id": "'"\$databasecredsid"'",
|
||||||
"secret": "\$databaseString",
|
"secret": "Host=${targetHost};Database=${servicename};Username=${servicename};Password=${env.pw_productiondatabase};IncludeErrorDetail=true;",
|
||||||
"description": "database connection string",
|
"description": "database connection string",
|
||||||
"\$class": "com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl"
|
"\$class": "com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl"
|
||||||
}
|
}
|
||||||
@ -151,9 +152,6 @@ pipeline {
|
|||||||
rm cookies.txt
|
rm cookies.txt
|
||||||
git add .
|
git add .
|
||||||
git commit -m \"set up for database\"
|
git commit -m \"set up for database\"
|
||||||
|
|
||||||
cp appsettings.sample.json appsettings.json
|
|
||||||
sed -i "s/\\"DBConnectionString\\" *: *\\"[^\\"]*\\"/\\"DBConnectionString\\":\\"\${databaseString}\\"/" appsettings.json
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@ -179,10 +177,7 @@ 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)\$'\\n'
|
privatekeycontent=\$(cat ${servicename}-ssh)
|
||||||
privatekeycontent="\$privatekeycontent
|
|
||||||
"
|
|
||||||
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)')
|
||||||
echo \$CRUMB
|
echo \$CRUMB
|
||||||
@ -273,9 +268,6 @@ pipeline {
|
|||||||
stage("initial service setup"){
|
stage("initial service setup"){
|
||||||
steps{
|
steps{
|
||||||
sh """#!/bin/bash
|
sh """#!/bin/bash
|
||||||
ssh -i "${servicename}-ssh" -tt ${servicename}@${targetHost} "mkdir -p ~/dist"
|
|
||||||
scp -i "${servicename}-ssh" ${servicename}/appsettings.json ${servicename}@${targetHost}:~/dist/appsettings.json
|
|
||||||
|
|
||||||
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