Skip to content
Snippets Groups Projects
Unverified Commit f235c504 authored by Piotr Balcer's avatar Piotr Balcer Committed by GitHub
Browse files

Merge pull request #5013 from...

Merge pull request #5013 from pmem/revert-5009-common-migrate-from-Docker-Hub-to-GitHub-Container-Registry

Revert "common: migrate from Docker Hub to GitHub Container Registry"
parents 7dc2e301 98e1809d
No related branches found
No related tags found
No related merge requests found
...@@ -7,24 +7,23 @@ on: ...@@ -7,24 +7,23 @@ on:
- cron: '0 0 * * *' - cron: '0 0 * * *'
env: env:
GITHUB_REPO: pmem/pmdk GITHUB_REPO: pmem/pmdk
DOCKER_REPO: ghcr.io/pmem/pmdk DOCKERHUB_REPO: 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
WORKDIR: utils/docker
PMDK_CC: gcc
PMDK_CXX: g++
MAKE_PKG: 0
REMOTE_TESTS: 1
VALGRIND: 1
jobs: jobs:
linux: linux:
name: Linux name: Linux
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
HOST_WORKDIR: /home/runner/work/pmdk/pmdk
WORKDIR: utils/docker
PMDK_CC: gcc
PMDK_CXX: g++
MAKE_PKG: 0
REMOTE_TESTS: 1
VALGRIND: 1
strategy: strategy:
matrix: matrix:
CONFIG: ["COVERITY=1 OS=ubuntu OS_VER=19.10"] CONFIG: ["COVERITY=1 OS=ubuntu OS_VER=19.10"]
......
...@@ -3,16 +3,16 @@ name: PMDK ...@@ -3,16 +3,16 @@ name: PMDK
on: [push, pull_request] on: [push, pull_request]
env: env:
GITHUB_REPO: pmem/pmdk GITHUB_REPO: pmem/pmdk
DOCKER_REPO: ghcr.io/pmem/pmdk DOCKERHUB_REPO: pmem/pmdk
GH_CR_USER: ${{ secrets.GH_CR_USER }}
GH_CR_PAT: ${{ secrets.GH_CR_PAT }}
jobs: jobs:
linux: linux:
name: Linux name: Linux
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOC_UPDATE_GITHUB_TOKEN: ${{ secrets.DOC_UPDATE_GITHUB_TOKEN }} DOC_UPDATE_GITHUB_TOKEN: ${{ secrets.DOC_UPDATE_GITHUB_TOKEN }}
HOST_WORKDIR: /home/runner/work/pmdk/pmdk HOST_WORKDIR: /home/runner/work/pmdk/pmdk
WORKDIR: utils/docker WORKDIR: utils/docker
......
...@@ -11,7 +11,7 @@ services: ...@@ -11,7 +11,7 @@ services:
env: env:
global: global:
- GITHUB_REPO=pmem/pmdk - GITHUB_REPO=pmem/pmdk
- DOCKER_REPO=ghcr.io/pmem/pmdk - DOCKERHUB_REPO=pmem/pmdk
- OS=ubuntu - OS=ubuntu
- OS_VER=19.10 - OS_VER=19.10
- MAKE_PKG=0 - MAKE_PKG=0
......
...@@ -15,5 +15,5 @@ subdirectory and then do git-rebase before pushing your commits to the ...@@ -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 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 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 images used during the build before the build. Otherwise the not-updated
Docker image will be pulled from GitHub Container Registry and used during Docker image will be pulled from the Docker Hub and used during the build on
the build on Travis and GitHub Actions CIs. Travis and GitHub Actions CIs.
...@@ -45,7 +45,7 @@ if [[ -z "$TEST_BUILD" ]]; then ...@@ -45,7 +45,7 @@ if [[ -z "$TEST_BUILD" ]]; then
TEST_BUILD=all TEST_BUILD=all
fi fi
imageName=${DOCKER_REPO}:1.10-${OS}-${OS_VER}-${CI_CPU_ARCH} imageName=${DOCKERHUB_REPO}:1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}
containerName=pmdk-${OS}-${OS_VER} containerName=pmdk-${OS}-${OS_VER}
if [[ $MAKE_PKG -eq 0 ]] ; then command="./run-build.sh"; fi if [[ $MAKE_PKG -eq 0 ]] ; then command="./run-build.sh"; fi
......
...@@ -34,7 +34,7 @@ export PMDK_CC=${PMDK_CC:-gcc} ...@@ -34,7 +34,7 @@ export PMDK_CC=${PMDK_CC:-gcc}
export PMDK_CXX=${PMDK_CXX:-g++} export PMDK_CXX=${PMDK_CXX:-g++}
export EXPERIMENTAL=${EXPERIMENTAL:-n} export EXPERIMENTAL=${EXPERIMENTAL:-n}
export VALGRIND=${VALGRIND:-1} export VALGRIND=${VALGRIND:-1}
export DOCKER_REPO=${DOCKER_REPO:-ghcr.io/pmem/pmdk} export DOCKERHUB_REPO=${DOCKERHUB_REPO:-pmem/pmdk}
export GITHUB_REPO=${GITHUB_REPO:-pmem/pmdk} export GITHUB_REPO=${GITHUB_REPO:-pmem/pmdk}
if [[ -z "$OS" || -z "$OS_VER" ]]; then if [[ -z "$OS" || -z "$OS_VER" ]]; then
...@@ -51,7 +51,7 @@ if [[ "$KEEP_CONTAINER" != "1" ]]; then ...@@ -51,7 +51,7 @@ if [[ "$KEEP_CONTAINER" != "1" ]]; then
RM_SETTING=" --rm" RM_SETTING=" --rm"
fi fi
imageName=${DOCKER_REPO}:1.10-${OS}-${OS_VER}-${CI_CPU_ARCH} imageName=${DOCKERHUB_REPO}:1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}
containerName=pmdk-${OS}-${OS_VER} containerName=pmdk-${OS}-${OS_VER}
if [[ $MAKE_PKG -eq 1 ]] ; then if [[ $MAKE_PKG -eq 1 ]] ; then
......
...@@ -40,13 +40,13 @@ if [[ ! -f "Dockerfile.$OS_VER" ]]; then ...@@ -40,13 +40,13 @@ if [[ ! -f "Dockerfile.$OS_VER" ]]; then
exit 1 exit 1
fi fi
if [[ -z "${DOCKER_REPO}" ]]; then if [[ -z "${DOCKERHUB_REPO}" ]]; then
echo "Error: DOCKER_REPO environment variable is not set" echo "Error: DOCKERHUB_REPO environment variable is not set"
exit 1 exit 1
fi fi
# Build a Docker image tagged with ${DOCKER_REPO}:OS-VER-ARCH # Build a Docker image tagged with ${DOCKERHUB_REPO}:OS-VER-ARCH
tag=${DOCKER_REPO}:1.10-${OS_VER}-${CPU_ARCH} tag=${DOCKERHUB_REPO}:1.10-${OS_VER}-${CPU_ARCH}
docker build -t $tag \ docker build -t $tag \
--build-arg http_proxy=$http_proxy \ --build-arg http_proxy=$http_proxy \
--build-arg https_proxy=$https_proxy \ --build-arg https_proxy=$https_proxy \
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
# Copyright 2016-2020, Intel Corporation # Copyright 2016-2020, Intel Corporation
# #
# push-image.sh - pushes the Docker image to GitHub Container Registry. # push-image.sh - pushes the Docker image to the Docker Hub.
# #
# The script utilizes $GH_CR_USER and $GH_CR_PAT variables # The script utilizes $DOCKERHUB_USER and $DOCKERHUB_PASSWORD variables
# to log in to GitHub Container Registry. The variables can be set # to log in to Docker Hub. The variables can be set in the Travis project's
# in the Travis project's configuration for automated builds. # configuration for automated builds.
# #
set -e set -e
...@@ -29,23 +29,23 @@ if [[ -z "$CI_CPU_ARCH" ]]; then ...@@ -29,23 +29,23 @@ if [[ -z "$CI_CPU_ARCH" ]]; then
exit 1 exit 1
fi fi
if [[ -z "${DOCKER_REPO}" ]]; then if [[ -z "${DOCKERHUB_REPO}" ]]; then
echo "DOCKER_REPO environment variable is not set" echo "DOCKERHUB_REPO environment variable is not set"
exit 1 exit 1
fi fi
TAG="1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}" TAG="1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}"
# Check if the image tagged with pmdk/OS-VER exists locally # Check if the image tagged with pmdk/OS-VER exists locally
if [[ ! $(docker images -a | awk -v pattern="^${DOCKER_REPO}:${TAG}\$" \ if [[ ! $(docker images -a | awk -v pattern="^${DOCKERHUB_REPO}:${TAG}\$" \
'$1":"$2 ~ pattern') ]] '$1":"$2 ~ pattern') ]]
then then
echo "ERROR: Docker image tagged ${DOCKER_REPO}:${TAG} does not exists locally." echo "ERROR: Docker image tagged ${DOCKERHUB_REPO}:${TAG} does not exists locally."
exit 1 exit 1
fi fi
# Log in to GitHub Container Registry # Log in to the Docker Hub
docker login https://ghcr.io -u="$GH_CR_USER" -p="$GH_CR_PAT" docker login -u="$DOCKERHUB_USER" -p="$DOCKERHUB_PASSWORD"
# Push the image to GitHub Container Registry # Push the image to the repository
docker push ${DOCKER_REPO}:${TAG} docker push ${DOCKERHUB_REPO}:${TAG}
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
# #
# If the Travis build is not of the "pull_request" type (i.e. in case of # 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 # merge after pull_request) and it succeed, the Docker image should be pushed
# to GitHub Container Registry repository. An empty file is created to signal # to the Docker Hub repository. An empty file is created to signal that to
# that to further scripts. # further scripts.
# #
# If the Docker image does not have to be rebuilt, it will be pulled from # If the Docker image does not have to be rebuilt, it will be pulled from
# GitHub Container Registry. # Docker Hub.
# #
set -e set -e
...@@ -82,7 +82,7 @@ for file in $files; do ...@@ -82,7 +82,7 @@ for file in $files; do
./build-image.sh ${OS}-${OS_VER} ${CI_CPU_ARCH} ./build-image.sh ${OS}-${OS_VER} ${CI_CPU_ARCH}
popd popd
# Check if the image has to be pushed to GitHub Container Registry # Check if the image has to be pushed to Docker Hub
# (i.e. the build is triggered by commits to the $GITHUB_REPO # (i.e. the build is triggered by commits to the $GITHUB_REPO
# repository's stable-* or master branch, and the Travis build is not # repository's stable-* or master branch, and the Travis build is not
# of the "pull_request" type). In that case, create the empty # of the "pull_request" type). In that case, create the empty
...@@ -92,10 +92,10 @@ for file in $files; do ...@@ -92,10 +92,10 @@ for file in $files; do
&& $CI_EVENT_TYPE != "pull_request" \ && $CI_EVENT_TYPE != "pull_request" \
&& $PUSH_IMAGE == "1" ]] && $PUSH_IMAGE == "1" ]]
then then
echo "The image will be pushed to GitHub Container Registry" echo "The image will be pushed to Docker Hub"
touch $CI_FILE_PUSH_IMAGE_TO_REPO touch $CI_FILE_PUSH_IMAGE_TO_REPO
else else
echo "Skip pushing the image to GitHub Container Registry" echo "Skip pushing the image to Docker Hub"
fi fi
if [[ $PUSH_IMAGE == "1" ]] if [[ $PUSH_IMAGE == "1" ]]
...@@ -108,10 +108,5 @@ for file in $files; do ...@@ -108,10 +108,5 @@ for file in $files; do
done done
# Getting here means rebuilding the Docker image is not required. # Getting here means rebuilding the Docker image is not required.
# The image will be pulled from GitHub Container Registry. # Pull the image from Docker Hub.
docker pull ${DOCKERHUB_REPO}:1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}
# 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}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment