Update gitlab-ci.yml

This commit is contained in:
Salt 2021-05-01 15:44:31 -05:00
parent 24f624a673
commit fa73ce8f58

View File

@ -10,7 +10,6 @@ variables:
stages: stages:
- build - build
# - test # - test
- push
services: services:
- docker:dind - docker:dind
before_script: before_script:
@ -32,48 +31,24 @@ Build:
--platform linux/amd64,linux/arm64 --platform linux/amd64,linux/arm64
--cache-from $CI_HUB_USERNAME/$CI_PROJECT_NAME:latest --cache-from $CI_HUB_USERNAME/$CI_PROJECT_NAME:latest
--tag $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA --tag $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA
--tag $CI_HUB_USERNAME/$CI_PROJECT_NAME:bleeding
--push --push
. .
- docker images - docker images
Build_Tag:
# TEST stage: build
# TODO: Fix this
#Test_HTTP_200:
# stage: test
# script:
# - apk add curl
# - docker run -d -p 8889:80 $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA
# - sleep 10
# - docker ps
# - netstat -tulpn
# - curl localhost:8889 | grep -ie '200 OK'
# - docker kill $(docker ps -q)
# PUSH
Push_When_Tag:
stage: push
only: only:
- tags - tags
script: script:
- docker pull $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA - docker pull $CI_HUB_USERNAME/$CI_PROJECT_NAME:latest || true
- docker buildx create --use
- > - >
docker tag docker buildx build
$CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA --pull
$CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME --platform linux/amd64,linux/arm64
- > --cache-from $CI_HUB_USERNAME/$CI_PROJECT_NAME:latest
docker tag --tag $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME
$CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA --tag $CI_HUB_USERNAME/$CI_PROJECT_NAME:latest
$CI_HUB_USERNAME/$CI_PROJECT_NAME:latest --push
.
- docker images - docker images
- docker push $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME
- docker push $CI_HUB_USERNAME/$CI_PROJECT_NAME:latest
Push_Bleeding:
stage: push
script:
- docker pull $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA
- >
docker tag
$CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA
$CI_HUB_USERNAME/$CI_PROJECT_NAME:bleeding
- docker images
- docker push $CI_HUB_USERNAME/$CI_PROJECT_NAME:bleeding