Fix Seaworthy/Airsloop to use tools/airship for Pegleg

Change-Id: I60b598268d5ad6334dc21c2dd1e2818850cdfc9e
This commit is contained in:
Kaspars Skels 2019-07-16 15:12:25 -05:00
parent 38cc109fb1
commit ae6b1c360b
3 changed files with 29 additions and 33 deletions

View File

@ -8,7 +8,8 @@ import org.yaml.snakeyaml.DumperOptions;
import groovy.json.JsonSlurperClassic import groovy.json.JsonSlurperClassic
import groovy.json.JsonOutput import groovy.json.JsonOutput
PEGLEG_IMAGE = 'quay.io/airshipit/pegleg:178c058474fb632806e281673d3eaf6be80fa854' COLLECT_DIR = 'airsloop'
BUNDLE_DIR = 'bundle'
KEYSTONE_URL = 'http://keystone.ucp.svc.cluster.local' KEYSTONE_URL = 'http://keystone.ucp.svc.cluster.local'
SHIPYARD_URL = 'http://shipyard-api.ucp.svc.cluster.local/api/v1.0' SHIPYARD_URL = 'http://shipyard-api.ucp.svc.cluster.local/api/v1.0'
@ -96,11 +97,6 @@ def reset_bare_metal = {
//// manifest utils //// manifest utils
def resolve_versions = {
def versions = readYaml file: 'global/software/config/versions.yaml'
PROMENADE_IMAGE = versions.data.images.ucp.promenade.promenade
}
def pegleg_site_collect = { def pegleg_site_collect = {
stage('Pegleg Site Collect') { stage('Pegleg Site Collect') {
@ -114,14 +110,17 @@ def pegleg_site_collect = {
sh "cp ${SSH_KEY} ssh-key" sh "cp ${SSH_KEY} ssh-key"
auth = "-u ${SSH_USER} -k /target/ssh-key" sh "sudo -E tools/airship pegleg site" +
cmd = "pegleg site ${auth} -r /target collect ${SITE_NAME} -s /target/${SITE_NAME}" " -u ${SSH_USER}" +
sh "sudo docker run --rm -t -v \$(pwd):/target ${PEGLEG_IMAGE} ${cmd}" " -k /target/ssh-key" +
" -r /target collect ${SITE_NAME}" +
" -s /target/${COLLECT_DIR}"
sh "sudo chown -R ubuntu:ubuntu ${COLLECT_DIR}"
} }
sh "tar czf site-config.tar.gz ${SITE_NAME}" sh "tar czf ${COLLECT_DIR}.tar.gz ${SITE_NAME}"
archiveArtifacts "${COLLECT_DIR}.tar.gz"
archiveArtifacts 'site-config.tar.gz'
} }
} }
@ -318,6 +317,10 @@ vm(image: 'ubuntu-16.04-server-cloudimg-amd64',
'sudo systemctl disable kubelet') 'sudo systemctl disable kubelet')
ssh.cmd (GENESIS_CREDS, GENESIS_IP, ssh.cmd (GENESIS_CREDS, GENESIS_IP,
'sudo systemctl disable docker') 'sudo systemctl disable docker')
ssh.cmd (GENESIS_CREDS, GENESIS_IP,
'sudo touch /forcefsck')
reset_bare_metal()
sh 'sudo apt-get update' sh 'sudo apt-get update'
sh 'sudo apt-get install docker.io -y' sh 'sudo apt-get install docker.io -y'
@ -338,8 +341,6 @@ vm(image: 'ubuntu-16.04-server-cloudimg-amd64',
'placement.openstack.svc.cluster.local" >> hosts' 'placement.openstack.svc.cluster.local" >> hosts'
sh 'sudo mv hosts /etc/hosts' sh 'sudo mv hosts /etc/hosts'
reset_bare_metal()
clone(AIRSHIP_MANIFESTS_REF) clone(AIRSHIP_MANIFESTS_REF)
// use updater tool to pull latest charts/images // use updater tool to pull latest charts/images
@ -347,8 +348,6 @@ vm(image: 'ubuntu-16.04-server-cloudimg-amd64',
uplift_versions() uplift_versions()
} }
resolve_versions()
pegleg_site_collect() pegleg_site_collect()
prom_config_gen() prom_config_gen()

View File

@ -11,8 +11,6 @@ import org.yaml.snakeyaml.DumperOptions;
import groovy.json.JsonSlurperClassic import groovy.json.JsonSlurperClassic
import groovy.json.JsonOutput import groovy.json.JsonOutput
PEGLEG_IMAGE = 'quay.io/airshipit/pegleg:178c058474fb632806e281673d3eaf6be80fa854'
COLLECT_DIR = 'seaworthy' COLLECT_DIR = 'seaworthy'
BUNDLE_DIR = 'bundle' BUNDLE_DIR = 'bundle'
@ -103,11 +101,6 @@ def reset_bare_metal = {
//// manifest utils //// manifest utils
def resolve_versions = {
def shipyard = readYaml file: "site/${SITE_NAME}/secrets/passphrases/ucp_shipyard_keystone_password.yaml"
SHIPYARD_PASSWD = shipyard.data
}
def pegleg_site_collect = { def pegleg_site_collect = {
stage('Pegleg Site Collect') { stage('Pegleg Site Collect') {
@ -121,9 +114,13 @@ def pegleg_site_collect = {
sh "cp ${SSH_KEY} ssh-key" sh "cp ${SSH_KEY} ssh-key"
auth = "-u ${SSH_USER} -k /target/ssh-key" sh "sudo -E tools/airship pegleg site" +
cmd = "pegleg site ${auth} -r /target collect ${SITE_NAME} -s /target/${COLLECT_DIR}" " -u ${SSH_USER}" +
sh "sudo docker run --rm -t -v \$(pwd):/target ${PEGLEG_IMAGE} ${cmd}" " -k /target/ssh-key" +
" -r /target collect ${SITE_NAME}" +
" -s /target/${COLLECT_DIR}"
sh "sudo chown -R ubuntu:ubuntu ${COLLECT_DIR}"
} }
sh "tar czf ${COLLECT_DIR}.tar.gz ${COLLECT_DIR}" sh "tar czf ${COLLECT_DIR}.tar.gz ${COLLECT_DIR}"
@ -137,7 +134,7 @@ def prom_config_gen = {
withEnv(['TERM_OPTS=-t']) { withEnv(['TERM_OPTS=-t']) {
sh "mkdir -p ${BUNDLE_DIR}" sh "mkdir -p ${BUNDLE_DIR}"
sh "sudo -E tools/airship promenade build-all --validators" + sh "sudo -E tools/airship promenade build-all --validators" +
" -o ${BUNDLE_DIR} /target/${COLLECT_DIR}/*.yaml" " -o ${BUNDLE_DIR} /target/${COLLECT_DIR}/*.yaml"
} }
sh "tar czf ${BUNDLE_DIR}.tar.gz ${BUNDLE_DIR}" sh "tar czf ${BUNDLE_DIR}.tar.gz ${BUNDLE_DIR}"
@ -322,12 +319,14 @@ vm(image: 'ubuntu-16.04-server-cloudimg-amd64',
'sudo systemctl disable kubelet') 'sudo systemctl disable kubelet')
ssh.cmd (GENESIS_CREDS, GENESIS_IP, ssh.cmd (GENESIS_CREDS, GENESIS_IP,
'sudo systemctl disable docker') 'sudo systemctl disable docker')
ssh.cmd (GENESIS_CREDS, GENESIS_IP,
'sudo touch /forcefsck')
reset_bare_metal()
sh 'sudo apt-get update' sh 'sudo apt-get update'
sh 'sudo apt-get install docker.io -y' sh 'sudo apt-get install docker.io -y'
reset_bare_metal()
clone(AIRSHIP_MANIFESTS_REF) clone(AIRSHIP_MANIFESTS_REF)
// use updater tool to pull latest charts/images // use updater tool to pull latest charts/images
@ -335,8 +334,6 @@ vm(image: 'ubuntu-16.04-server-cloudimg-amd64',
uplift_versions() uplift_versions()
} }
resolve_versions()
pegleg_site_collect() pegleg_site_collect()
prom_config_gen() prom_config_gen()

View File

@ -1,7 +1,7 @@
pipelineJob('Seaworthy') { pipelineJob('Seaworthy') {
displayName('Airship Seaworthy') displayName('Seaworthy')
description('Bare-metal continuous deployment pipeline') description('Bare-metal continuous deployment pipeline')
logRotator { logRotator {
@ -79,7 +79,7 @@ pipelineJob('Seaworthy') {
definition { definition {
cps { cps {
script(readFileFromWorkspace("tools/gate/seaworthy/Jenkinsfile")) script(readFileFromWorkspace("tools/gate/seaworthy/Jenkinsfile"))
sandbox() sandbox(false)
} }
} }
} }