Skip to content

Commit

Permalink
fix(retry): retrying in this way will use less CI resources
Browse files Browse the repository at this point in the history
  • Loading branch information
hutchic committed Oct 24, 2022
1 parent 1801d79 commit 269c551
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ pipeline {
PRIVATE_KEY_FILE = credentials('kong.private.gpg-key.asc')
PRIVATE_KEY_PASSPHRASE = credentials('kong.private.gpg-key.asc.password')
}
options {
retry(2)
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done'
Expand All @@ -67,6 +70,9 @@ pipeline {
PATH = "/home/ubuntu/bin/:${env.PATH}"
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
}
options {
retry(2)
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done'
Expand All @@ -87,6 +93,9 @@ pipeline {
PATH = "/home/ubuntu/bin/:${env.PATH}"
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
}
options {
retry(2)
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done'
Expand All @@ -111,6 +120,9 @@ pipeline {
DOCKER_REPOSITORY = "kong/kong-build-tools-private"
KONG_PACKAGE_NAME = "kong-enterprise-edition-fips"
}
options {
retry(2)
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done'
Expand Down Expand Up @@ -145,6 +157,9 @@ pipeline {
PRIVATE_KEY_FILE = credentials('kong.private.gpg-key.asc')
PRIVATE_KEY_PASSPHRASE = credentials('kong.private.gpg-key.asc.password')
}
options {
retry(2)
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done'
Expand All @@ -165,6 +180,9 @@ pipeline {
AWS_ACCESS_KEY = "instance-profile"
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
}
options {
retry(2)
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done'
Expand All @@ -185,6 +203,9 @@ pipeline {
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
PATH = "/home/ubuntu/bin/:${env.PATH}"
}
options {
retry(2)
}
steps {
sh 'mkdir -p /home/ubuntu/bin/'
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
Expand Down
3 changes: 2 additions & 1 deletion dockerfiles/Dockerfile.openresty
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ COPY lua-kong-nginx-module /distribution/lua-kong-nginx-module
COPY lua-resty-lmdb /distribution/lua-resty-lmdb

ARG DEBUG=1
RUN DEBUG="${DEBUG}" /tmp/build-openresty.sh
ENV DEBUG $DEBUG
RUN /tmp/build-openresty.sh || /tmp/build-openresty.sh

RUN sed -i 's/\/tmp\/build//' `grep -l -I -r '\/tmp\/build' /tmp/build/` || true

Expand Down

0 comments on commit 269c551

Please sign in to comment.