gitlab-notification/.gitlab-ci.yml
Struchkov Mark 81e7f8be54 test cicd
2022-01-26 18:05:19 +03:00

54 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

stages:
- build
- deploy
build:
image: maven:3.8.4-openjdk-17
stage: build
variables:
MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository"
only:
- test
# except:
# - branches
script:
- 'mvn -U clean package'
artifacts:
paths:
- gitlab-app/target/gitlab-notification.jar
docker-build:
image: upagge/docker-buildx:latest
stage: deploy
only:
- 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 buildx create --use
- docker buildx build --platform linux/amd64 -f Dockerfile-linux -t "upagge/test:latest" .
- docker buildx build --platform linux/arm64/v8 -f Docker-maс -t "upagge/test:latest" .
# - 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"