diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 4e942f7bfe706a423ccd10529603dbfbe1f1b549..ca85df5003727c4e660b69f15db6285f174f3850 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -8,7 +8,9 @@ on: env: GITHUB_REPO: pmem/pmdk - DOCKER_REPO: pmem/pmdk + DOCKER_REPO: ghcr.io/pmem/pmdk + GH_CR_USER: ${{ secrets.GH_CR_USER }} + GH_CR_PAT: ${{ secrets.GH_CR_PAT }} COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }} COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} HOST_WORKDIR: /home/runner/work/pmdk/pmdk diff --git a/.github/workflows/gha.yml b/.github/workflows/gha.yml index dfdaf281bcfd7b1b614b822afe1889bfe6ef3134..e8861597e707ade855f527763b83150809a9d5f2 100644 --- a/.github/workflows/gha.yml +++ b/.github/workflows/gha.yml @@ -4,15 +4,15 @@ on: [push, pull_request] env: GITHUB_REPO: pmem/pmdk - DOCKER_REPO: pmem/pmdk + DOCKER_REPO: ghcr.io/pmem/pmdk + GH_CR_USER: ${{ secrets.GH_CR_USER }} + GH_CR_PAT: ${{ secrets.GH_CR_PAT }} jobs: linux: name: Linux runs-on: ubuntu-latest env: - DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} DOC_UPDATE_GITHUB_TOKEN: ${{ secrets.DOC_UPDATE_GITHUB_TOKEN }} HOST_WORKDIR: /home/runner/work/pmdk/pmdk WORKDIR: utils/docker diff --git a/.travis.yml b/.travis.yml index e5de2ab1682aed11e9af3007c29ececc5569aaa8..d1af3b1556732ff1bf1525b71ef9f9aa28c94c15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ services: env: global: - GITHUB_REPO=pmem/pmdk - - DOCKER_REPO=pmem/pmdk + - DOCKER_REPO=ghcr.io/pmem/pmdk - OS=ubuntu - OS_VER=19.10 - MAKE_PKG=0 diff --git a/utils/docker/README b/utils/docker/README index b4a271359adb51ef85b874abfe21b5113cdee16b..57c3a7d3e4cc320d85c897f39dab4855a32e4283 100644 --- a/utils/docker/README +++ b/utils/docker/README @@ -15,5 +15,5 @@ subdirectory and then do git-rebase before pushing your commits to the repository, make sure that you do not squash the commit which is the head in your repository. This will let Travis and GitHub Actions CIs recreate Docker images used during the build before the build. Otherwise the not-updated -Docker image will be pulled from the Docker Hub and used during the build on -Travis and GitHub Actions CIs. +Docker image will be pulled from GitHub Container Registry and used during +the build on Travis and GitHub Actions CIs. diff --git a/utils/docker/build-local.sh b/utils/docker/build-local.sh index f805501756b9ea90b002a269303c25dedb8426ce..fea48b0146bf6088a021da797562a17367424328 100755 --- a/utils/docker/build-local.sh +++ b/utils/docker/build-local.sh @@ -34,7 +34,7 @@ export PMDK_CC=${PMDK_CC:-gcc} export PMDK_CXX=${PMDK_CXX:-g++} export EXPERIMENTAL=${EXPERIMENTAL:-n} export VALGRIND=${VALGRIND:-1} -export DOCKER_REPO=${DOCKER_REPO:-pmem/pmdk} +export DOCKER_REPO=${DOCKER_REPO:-ghcr.io/pmem/pmdk} export GITHUB_REPO=${GITHUB_REPO:-pmem/pmdk} if [[ -z "$OS" || -z "$OS_VER" ]]; then diff --git a/utils/docker/images/push-image.sh b/utils/docker/images/push-image.sh index 77292d4cc36dfb2dfa5a9870b5a11096277e7e88..a7bd4cc7cf23d4ff92a38192cc4f03da39cd4bd7 100755 --- a/utils/docker/images/push-image.sh +++ b/utils/docker/images/push-image.sh @@ -3,11 +3,11 @@ # Copyright 2016-2020, Intel Corporation # -# push-image.sh - pushes the Docker image to the Docker Hub. +# push-image.sh - pushes the Docker image to GitHub Container Registry. # -# The script utilizes $DOCKERHUB_USER and $DOCKERHUB_PASSWORD variables -# to log in to Docker Hub. The variables can be set in the Travis project's -# configuration for automated builds. +# The script utilizes $GH_CR_USER and $GH_CR_PAT variables +# to log in to GitHub Container Registry. The variables can be set +# in the Travis project's configuration for automated builds. # set -e @@ -44,8 +44,8 @@ then exit 1 fi -# Log in to the Docker Hub -docker login -u="$DOCKERHUB_USER" -p="$DOCKERHUB_PASSWORD" +# Log in to GitHub Container Registry +docker login https://ghcr.io -u="$GH_CR_USER" -p="$GH_CR_PAT" -# Push the image to the repository +# Push the image to GitHub Container Registry docker push ${DOCKER_REPO}:${TAG} diff --git a/utils/docker/pull-or-rebuild-image.sh b/utils/docker/pull-or-rebuild-image.sh index 79c63ad163ced40848aa7986a4dd4778fb328378..8ce16ae4b4a4e57ac230ca60bc2379b5d943cb5e 100755 --- a/utils/docker/pull-or-rebuild-image.sh +++ b/utils/docker/pull-or-rebuild-image.sh @@ -12,11 +12,11 @@ # # If the Travis build is not of the "pull_request" type (i.e. in case of # merge after pull_request) and it succeed, the Docker image should be pushed -# to the Docker Hub repository. An empty file is created to signal that to -# further scripts. +# to GitHub Container Registry repository. An empty file is created to signal +# that to further scripts. # # If the Docker image does not have to be rebuilt, it will be pulled from -# Docker Hub. +# GitHub Container Registry. # set -e @@ -82,7 +82,7 @@ for file in $files; do ./build-image.sh ${OS}-${OS_VER} ${CI_CPU_ARCH} popd - # Check if the image has to be pushed to Docker Hub + # Check if the image has to be pushed to GitHub Container Registry # (i.e. the build is triggered by commits to the $GITHUB_REPO # repository's stable-* or master branch, and the Travis build is not # of the "pull_request" type). In that case, create the empty @@ -92,10 +92,10 @@ for file in $files; do && $CI_EVENT_TYPE != "pull_request" \ && $PUSH_IMAGE == "1" ]] then - echo "The image will be pushed to Docker Hub" + echo "The image will be pushed to GitHub Container Registry" touch $CI_FILE_PUSH_IMAGE_TO_REPO else - echo "Skip pushing the image to Docker Hub" + echo "Skip pushing the image to GitHub Container Registry" fi if [[ $PUSH_IMAGE == "1" ]] @@ -108,5 +108,10 @@ for file in $files; do done # Getting here means rebuilding the Docker image is not required. -# Pull the image from Docker Hub. +# The image will be pulled from GitHub Container Registry. + +# Log in to GitHub Container Registry +docker login https://ghcr.io -u="$GH_CR_USER" -p="$GH_CR_PAT" + +# Pull the image from GitHub Container Registry. docker pull ${DOCKER_REPO}:1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}