Skip to content

Commit

Permalink
ci: support no secrets for dependabot (elastic#3473)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Dec 21, 2023
1 parent 140392c commit f1c5748
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
20 changes: 19 additions & 1 deletion .ci/scripts/jboss-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,32 @@
# Bash strict mode
set -eo pipefail

# Retry the given command for the given times.
retry() {
local retries=$1
shift
local count=0
until "$@"; do
exit=$?
wait=$((2 ** count))
count=$((count + 1))
if [ $count -lt "$retries" ]; then
sleep $wait
else
return $exit
fi
done
return 0
}

## This script is used by the CI to be able to re-tag the docker images
## to use the official docker namespace.
## Or by an Elastic employee to configure the docker images as needed.
while read -r i ; do
[[ -z $i ]] && continue
name="${i##*/}"
echo "::group::$name"
docker pull docker.elastic.co/observability-ci/$name --platform linux/amd64
retry 3 docker pull --platform linux/amd64 docker.elastic.co/observability-ci/$name
docker tag docker.elastic.co/observability-ci/$name $i
echo "::endgroup::"
done < .ci/scripts/jboss-docker-images.txt
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ jobs:
name: JBoss integration tests
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'pull_request' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
# If no PR event or if a PR event that's caused by a non-fork and non dependabot actor
if: github.event_name != 'pull_request' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' )
steps:
- uses: actions/checkout@v4
- uses: elastic/apm-pipeline-library/.github/actions/docker-login@current
Expand Down

0 comments on commit f1c5748

Please sign in to comment.