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

Docker product #5805

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions .github/workflows/docker_rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ on:
- master
paths:
- 'utils/docker/images/**'
- '.github/workflows/docker_rebuild.yml'

push:
branches:
- master
paths:
- 'utils/docker/images/**'
- '.github/workflows/docker_rebuild.yml'
schedule:
# run this job at 22:00 UTC every other day (hopefully just before the nightly)
- cron: '0 22 */2 * *'
Expand Down Expand Up @@ -47,9 +50,6 @@ jobs:
steps:
- name: Clone the git repo
uses: actions/checkout@v3

- name: Get system information
run: ./$WORKDIR/get-system-info.sh

- name: Pull or rebuild the image
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh rebuild
14 changes: 10 additions & 4 deletions utils/docker/pull-or-rebuild-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,21 @@ function push_image {
# - not a pull_request event,
# - and PUSH_IMAGE flag was set for current build.
if [[ "${CI_REPO_SLUG}" == "${GITHUB_REPO}" \
&& (${CI_BRANCH} == stable-* || ${CI_BRANCH} == devel-* || ${CI_BRANCH} == master) \
&& ${CI_EVENT_TYPE} != "pull_request" \
&& ${PUSH_IMAGE} == "1" ]]
&& (((${CI_BRANCH} == stable-* || ${CI_BRANCH} == devel-* || ${CI_BRANCH} == master) \
&& ${CI_EVENT_TYPE} != "pull_request") \
|| ${PUSH_IMAGE} == "1") ]]
then
echo "The image will be pushed to the Container Registry: ${DOCKER_REPO}"
pushd ${images_dir_name}
./push-image.sh
popd
else
echo "Skip pushing the image to the ${DOCKER_REPO}."
echo "CI_REPO_SLUG: ${CI_REPO_SLUG}"
echo "GITHUB_REPO: ${GITHUB_REPO}"
echo "CI_BRANCH: ${CI_BRANCH}"
echo "CI_EVENT_TYPE: ${CI_EVENT_TYPE}"
echo "PUSH_IMAGE: ${PUSH_IMAGE}"
fi
}

Expand Down Expand Up @@ -108,7 +113,8 @@ for file in $files; do echo $file; done
for file in $files; do
# Check if modified files are relevant to the current build
if [[ $file =~ ^($base_dir)\/Dockerfile\.($OS)-($OS_VER)$ ]] \
|| [[ $file =~ ^($base_dir)\/.*\.sh$ ]]
|| [[ $file =~ ^($base_dir)\/.*\.sh$ ]] \
|| [[ $file =~ ^($base_dir)\/\.\.\/\.\.\/\.\.\/\.github\/workflows\/docker_rebuild\.yml ]]
then
build_image
push_image
Expand Down
Loading