From 6e37b2db2348065c4488e9076d02fd3995ddc4d1 Mon Sep 17 00:00:00 2001 From: "Pavel@Vostro5468" Date: Mon, 21 Mar 2022 23:12:42 +0300 Subject: [PATCH] update build, added push to mxfox --- .agola/config.yml | 72 +++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 49 deletions(-) diff --git a/.agola/config.yml b/.agola/config.yml index 0d35d90..8f904bb 100644 --- a/.agola/config.yml +++ b/.agola/config.yml @@ -1,7 +1,7 @@ version: v0 runs: - - name: sample run + - name: Build image docker_registries_auth: 'mxfox.ru': username: @@ -9,23 +9,10 @@ runs: password: from_variable: mxfoxdockersecret tasks: - - name: checkout code - runtime: - containers: - - image: alpine/git - steps: - - clone: - - save_to_workspace: - contents: - - source_dir: . - dest_dir: . - paths: - - '**' - - name: build docker image runtime: containers: - - image: mxfox.ru/test/docker-buildx:dind + - image: mxfox.ru/test/docker-buildx:dind-git privileged: true #shell: /busybox/sh working_dir: /workspace @@ -35,39 +22,26 @@ runs: DOCKERPASS: from_variable: mxfoxdockersecret steps: - - restore_workspace: - dest_dir: . + - clone: - run: - name: docker start - command: | - dockerd --experimental & - x_state="FAIL" - for i in $(seq 60 $END) - do - sleep 1; - if test -e "/var/run/docker.sock" - then - x_state="OK" - break - fi - echo "check..." $i - done - - 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 . + name: buildX prepare + command: buildx-bgstart.sh - depends: - - checkout code \ No newline at end of file + - run: + name: buildX build + command: | + case ${AGOLA_GIT_BRANCH} in + master) + export xBuildSuffix=" -t mxfox.ru/infra/fox-proxy:latest --push" + ;; + test) + export xBuildSuffix=" -t mxfox.ru/infra/fox-proxy:test --push" + ;; + *) + export xBuildSuffix="" + ;; + esac + docker login mxfox.ru -u ${DOCKERLOGIN} -p ${DOCKERPASS} + docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 . ${xBuildSuffix} + +