44 lines
1.5 KiB
YAML
44 lines
1.5 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/mxfox/docker-dind.buildx:latest
|
||
|
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/mxfox/fox-converter:master-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/mxfox/fox-converter:latest --push"
|
||
|
;;
|
||
|
testing)
|
||
|
export xBuildSuffix=" -t mxfox.ru/mxfox/fox-converter:test-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/mxfox/fox-converter:test --push"
|
||
|
;;
|
||
|
*)
|
||
|
export xBuildSuffix=""
|
||
|
;;
|
||
|
esac
|
||
|
docker login mxfox.ru -u ${DOCKERLOGIN} -p ${DOCKERPASS}
|
||
|
docker buildx build --platform linux/amd64,linux/arm64,linux/arm . ${xBuildSuffix}
|