diff --git a/playbooks/pbrx-push/post.yaml b/playbooks/pbrx-push/post.yaml new file mode 100644 index 0000000000..50d65f4962 --- /dev/null +++ b/playbooks/pbrx-push/post.yaml @@ -0,0 +1,18 @@ +- hosts: all + tasks: + + - name: Docker Hub login + command: docker login -u {{ openstackzuul_docker_login.user }} -p {{ openstackzuul_docker_login.password }} + no_log: True + + - block: + + - name: Push prefixed container images + command: 'pbrx --debug push-images --prefix={{ pbrx_prefix }}' + args: + chdir: '{{ zuul_work_dir|default(zuul.project.src_dir) }}' + + always: + + - name: Docker Hub logout + command: docker logout diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 8ac79a9b4e..03ca2b41a8 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -1322,3 +1322,15 @@ The testing is done for Ubuntu Xenial. nodeset: ubuntu-xenial + +- job: + name: openstackzuul-pbrx-push-container-images + parent: pbrx-build-container-images + description: | + Publish images built by pbrx to openstackzuul Docker Hub account. + A value must be supplied for the pbrx_prefix variable. + protected: true + final: true + post-run: playbooks/pbrx-push/post.yaml + secrets: + - openstackzuul_docker_login diff --git a/zuul.d/secrets.yaml b/zuul.d/secrets.yaml index cba6dceb9f..5a479ba930 100644 --- a/zuul.d/secrets.yaml +++ b/zuul.d/secrets.yaml @@ -582,3 +582,18 @@ user_domain_id: default region_name: ca-ymq-1 +- secret: + name: openstackzuul_docker_login + data: + user: 'openstackzuul' + password: !encrypted/pkcs1-oaep + - iTTRNGTV3i7J7/Eap3qozqsLi457apOAXoNuFsjRRNrG0NxEnFLair8b23JLSRWH8QN87 + 95QRyh2cNIjhtpES5g6vPOLPRe5FU8K/3nz28mLdneGIkLS6Z6v8h3SLClJbgi5X2Pb0U + 0Q2+pHR5PBDNtB+w70sFbIH4caojDrOt+PCdhVAkwxKAmIK3faW1b96mym9qW/so79p8h + /taSKWEFJxDhykyiJ+PgNa1hsE/n5v7A4DWSaNJeGaOQf8lT5RN3yZEGMFkISe/zQ7lQL + dEdKHj5/8izcHffwE7ixDmJim3PN2QrBoDJr+Vcvla24B0EnTj+b4ZTXXg5GeTpRUsJXJ + TQdMgTQV1Zgmh2yVnEpyX4S+N2YVFioT1f2CSFpYIRx2qeA4ZacRaPgsNBEnEzAEtlS7e + afktTydHMPJw2Z1BcV9SDzFEuAqtAmp5+asLYemQKymfeKYSdgF4q6NjtaXhDefhw1xtL + ZxPTxlPemfpyASod1S6FatARLicSFyHJj9XQpfZzkxKpDQicG/QmOehFvjN9U1rlEFT5u + rbkgWewQP2/4BE/dHr5ndXHKQURikqo/RAGH2SqAdLSHs/lL9wB210Ci2PdIsr7ZubqA4 + UtW1IBx1OYB7pkyRad7PkqeC4wC9HjSrf3bJ1INF10mQ0rg2Kpt1vDK48BzDco=