Unverified Commit 41c2e076 authored by Denis_P's avatar Denis_P 🏑 Committed by GitHub
Browse files

CI: buildah to build images (#2125)

* CI: buildah to build images

* CI: secure login
parent dd9ad157
Pipeline #117396 passed with stages
in 20 minutes and 13 seconds
...@@ -227,9 +227,7 @@ generate-impl-guide: ...@@ -227,9 +227,7 @@ generate-impl-guide:
publish-docker: publish-docker:
<<: *publish-build <<: *publish-build
image: docker:stable image: quay.io/buildah/stable
services:
- docker:dind
<<: *collect-artifacts <<: *collect-artifacts
# Don't run on releases - this is handled by the Github Action here: # Don't run on releases - this is handled by the Github Action here:
# .github/workflows/publish-docker-release.yml # .github/workflows/publish-docker-release.yml
...@@ -238,26 +236,29 @@ publish-docker: ...@@ -238,26 +236,29 @@ publish-docker:
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "master"
variables: variables:
DOCKER_HOST: tcp://localhost:2375
DOCKER_DRIVER: overlay2
GIT_STRATEGY: none GIT_STRATEGY: none
# DOCKERFILE: scripts/docker/Dockerfile # DOCKERFILE: scripts/docker/Dockerfile
CONTAINER_IMAGE: parity/polkadot IMAGE_NAME: docker.io/parity/polkadot
script: script:
- test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity" - test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity" ||
|| ( echo "no docker credentials provided"; exit 1 ) ( echo "no docker credentials provided"; exit 1 )
- docker login -u "$Docker_Hub_User_Parity" -p "$Docker_Hub_Pass_Parity"
- docker info
- cd ./artifacts - cd ./artifacts
- docker build - buildah bud
--squash
--format=docker
--build-arg VCS_REF="${CI_COMMIT_SHA}" --build-arg VCS_REF="${CI_COMMIT_SHA}"
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
--tag $CONTAINER_IMAGE:$VERSION --tag "$IMAGE_NAME:$VERSION"
--tag $CONTAINER_IMAGE:$EXTRATAG . --tag "$IMAGE_NAME:$EXTRATAG" .
- docker push $CONTAINER_IMAGE:$VERSION - echo "$Docker_Hub_Pass_Parity" |
- docker push $CONTAINER_IMAGE:$EXTRATAG buildah login --username "$Docker_Hub_User_Parity" --password-stdin docker.io
- buildah info
- buildah push
--format=v2s2
"$IMAGE_NAME:$VERSION"
"$IMAGE_NAME:$EXTRATAG"
after_script: after_script:
- docker logout - buildah logout "$IMAGE_NAME"
# only VERSION information is needed for the deployment # only VERSION information is needed for the deployment
- find ./artifacts/ -depth -not -name VERSION -not -name artifacts -delete - find ./artifacts/ -depth -not -name VERSION -not -name artifacts -delete
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment