Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8SPS-251 fix ps containers builds #2019

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cloud/jenkins/ps_containers_docker_build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void checkImageForDocker(String IMAGE_SUFFIX){
sh """
IMAGE_SUFFIX=${IMAGE_SUFFIX}
IMAGE_NAME='percona-server-mysql-operator'
TrivyLog="$WORKSPACE/trivy-\$IMAGE_NAME-\${IMAGE_SUFFIX}.xml"
TrivyLog="$WORKSPACE/trivy-\$IMAGE_NAME-${IMAGE_SUFFIX}.xml"
wget https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/junit.tpl

sg docker -c "
Expand All @@ -46,18 +46,18 @@ void checkImageForDocker(String IMAGE_SUFFIX){
void pushImageToDocker(String IMAGE_POSTFIX){
withCredentials([usernamePassword(credentialsId: 'hub.docker.com', passwordVariable: 'PASS', usernameVariable: 'USER'), file(credentialsId: 'DOCKER_REPO_KEY', variable: 'docker_key')]) {
sh """
sg docker -c '
IMAGE_POSTFIX=${IMAGE_POSTFIX}
sg docker -c "
if [ ! -d ~/.docker/trust/private ]; then
mkdir -p /home/ec2-user/.docker/trust/private
cp "${docker_key}" ~/.docker/trust/private/
cp '${docker_key}' ~/.docker/trust/private/
fi

docker login -u '${USER}' -p '${PASS}'
export DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE="${DOCKER_REPOSITORY_PASSPHRASE}"
docker trust sign perconalab/percona-server-mysql-operator:${GIT_PD_BRANCH}-${IMAGE_POSTFIX}
docker push perconalab/percona-server-mysql-operator:${GIT_PD_BRANCH}-${IMAGE_POSTFIX}
docker logout
'
"
"""
}
}
Expand Down