From 35c3c5b49b23c594c376ea798ce90cb0d83af3b5 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 26 Jan 2022 12:41:36 +0300 Subject: [PATCH] test cicd --- .gitlab-ci.yml | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c51a2fb..d61a6fe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,36 +1,53 @@ -image: maven:3.8.4-openjdk-17 -variables: - MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository" - stages: - build - deploy build: + image: maven:3.8.4-openjdk-17 stage: build + variables: + MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository" only: - - /^v.*$/ - except: - - branches + - test +# except: +# - branches script: - 'mvn -U clean package' artifacts: paths: - gitlab-app/target/gitlab-notification.jar -docker-build-master: - image: docker:latest +docker-build: + image: docker/buildx-bin stage: deploy only: - - /^v.*$/ - except: - - branches + - test +# except: +# - branches services: - docker:dind before_script: - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin script: - cd gitlab-app - - docker build --no-cache -f Dockerfile-linux -t "$CI_REGISTRY_IMAGE:latest" . -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" - - docker push "$CI_REGISTRY_IMAGE:latest" - - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" \ No newline at end of file + - docker buildx create --use + - docker buildx build --push --no-cache --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -f Dockerfile-linux -t "$CI_REGISTRY_IMAGE:latest" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" . +# - docker push "$CI_REGISTRY_IMAGE:latest" +# - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" + +#docker-build-master: +# image: docker/buildx-bin +# stage: deploy +# only: +# - /^v.*$/ +# except: +# - branches +# services: +# - docker:dind +# before_script: +# - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin +# script: +# - cd gitlab-app +# - docker build --no-cache -f Dockerfile-linux -t "$CI_REGISTRY_IMAGE:latest" . -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" +# - docker push "$CI_REGISTRY_IMAGE:latest" +# - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" \ No newline at end of file