47 lines
1.7 KiB
YAML
47 lines
1.7 KiB
YAML
|
version: v0
|
||
|
runs:
|
||
|
- name: Build image
|
||
|
docker_registries_auth:
|
||
|
'mxfox.ru':
|
||
|
username:
|
||
|
from_variable: mxfoxdockerlogin
|
||
|
password:
|
||
|
from_variable: mxfoxdockersecret
|
||
|
tasks:
|
||
|
- name: build docker image
|
||
|
runtime:
|
||
|
containers:
|
||
|
- image: mxfox.ru/test/docker-buildx:dind-git
|
||
|
privileged: true
|
||
|
#shell: /busybox/sh
|
||
|
working_dir: /workspace
|
||
|
environment:
|
||
|
DOCKERLOGIN:
|
||
|
from_variable: mxfoxdockerlogin
|
||
|
DOCKERPASS:
|
||
|
from_variable: mxfoxdockersecret
|
||
|
steps:
|
||
|
- clone:
|
||
|
- run:
|
||
|
name: buildX prepare
|
||
|
command: buildx-bgstart.sh
|
||
|
|
||
|
- run:
|
||
|
name: buildX build
|
||
|
command: |
|
||
|
case ${AGOLA_GIT_BRANCH} in
|
||
|
master)
|
||
|
export xBuildSuffix=" -t mxfox.ru/chimera/fox-web-basic:master-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/chimera/fox-web-basic:latest --push"
|
||
|
;;
|
||
|
test)
|
||
|
export xBuildSuffix=" -t mxfox.ru/chimera/fox-web-basic:test-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/chimera/fox-web-basic:test --push"
|
||
|
;;
|
||
|
php7.4)
|
||
|
export xBuildSuffix=" -t mxfox.ru/chimera/fox-web-basic:php-7.4-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/chimera/fox-web-basic:php-7.4 --push"
|
||
|
;;
|
||
|
*)
|
||
|
export xBuildSuffix=""
|
||
|
;;
|
||
|
esac
|
||
|
docker login mxfox.ru -u ${DOCKERLOGIN} -p ${DOCKERPASS}
|
||
|
docker buildx build --platform linux/amd64,linux/arm64 . ${xBuildSuffix}
|