update build, added push to mxfox
This commit is contained in:
parent
2b1f89c2f3
commit
6e37b2db23
|
@ -1,7 +1,7 @@
|
||||||
version: v0
|
version: v0
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
- name: sample run
|
- name: Build image
|
||||||
docker_registries_auth:
|
docker_registries_auth:
|
||||||
'mxfox.ru':
|
'mxfox.ru':
|
||||||
username:
|
username:
|
||||||
|
@ -9,23 +9,10 @@ runs:
|
||||||
password:
|
password:
|
||||||
from_variable: mxfoxdockersecret
|
from_variable: mxfoxdockersecret
|
||||||
tasks:
|
tasks:
|
||||||
- name: checkout code
|
|
||||||
runtime:
|
|
||||||
containers:
|
|
||||||
- image: alpine/git
|
|
||||||
steps:
|
|
||||||
- clone:
|
|
||||||
- save_to_workspace:
|
|
||||||
contents:
|
|
||||||
- source_dir: .
|
|
||||||
dest_dir: .
|
|
||||||
paths:
|
|
||||||
- '**'
|
|
||||||
|
|
||||||
- name: build docker image
|
- name: build docker image
|
||||||
runtime:
|
runtime:
|
||||||
containers:
|
containers:
|
||||||
- image: mxfox.ru/test/docker-buildx:dind
|
- image: mxfox.ru/test/docker-buildx:dind-git
|
||||||
privileged: true
|
privileged: true
|
||||||
#shell: /busybox/sh
|
#shell: /busybox/sh
|
||||||
working_dir: /workspace
|
working_dir: /workspace
|
||||||
|
@ -35,39 +22,26 @@ runs:
|
||||||
DOCKERPASS:
|
DOCKERPASS:
|
||||||
from_variable: mxfoxdockersecret
|
from_variable: mxfoxdockersecret
|
||||||
steps:
|
steps:
|
||||||
- restore_workspace:
|
- clone:
|
||||||
dest_dir: .
|
|
||||||
- run:
|
- run:
|
||||||
name: docker start
|
name: buildX prepare
|
||||||
|
command: buildx-bgstart.sh
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: buildX build
|
||||||
command: |
|
command: |
|
||||||
dockerd --experimental &
|
case ${AGOLA_GIT_BRANCH} in
|
||||||
x_state="FAIL"
|
master)
|
||||||
for i in $(seq 60 $END)
|
export xBuildSuffix=" -t mxfox.ru/infra/fox-proxy:latest --push"
|
||||||
do
|
;;
|
||||||
sleep 1;
|
test)
|
||||||
if test -e "/var/run/docker.sock"
|
export xBuildSuffix=" -t mxfox.ru/infra/fox-proxy:test --push"
|
||||||
then
|
;;
|
||||||
x_state="OK"
|
*)
|
||||||
break
|
export xBuildSuffix=""
|
||||||
fi
|
;;
|
||||||
echo "check..." $i
|
esac
|
||||||
done
|
docker login mxfox.ru -u ${DOCKERLOGIN} -p ${DOCKERPASS}
|
||||||
|
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 . ${xBuildSuffix}
|
||||||
|
|
||||||
if [ "$x_state" == "FAIL" ]
|
|
||||||
then
|
|
||||||
echo "FAILED"
|
|
||||||
exit 9
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: buildx prepare
|
|
||||||
command: |
|
|
||||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
||||||
docker buildx create --name multiarch --driver docker-container --use
|
|
||||||
docker buildx inspect --bootstrap
|
|
||||||
- run:
|
|
||||||
name: buildX run
|
|
||||||
command: docker buildx build --platform linux/amd64,linux/arm64 .
|
|
||||||
|
|
||||||
depends:
|
|
||||||
- checkout code
|
|
Loading…
Reference in New Issue