Commit cdb11c1a authored by echel0n's avatar echel0n
Browse files

Disabled review for CI script

parent ffe965b1
stages:
- review_webpack
- review_docker
- review_deploy
# - review_webpack
# - review_docker
# - review_deploy
- release_build
- release_sentry
- release_deploy
review:webpack:
stage: review_webpack
image:
name: nikolaik/python-nodejs:python3.7-nodejs10-alpine
variables:
NODE_ENV: "development"
script:
- apk add --no-cache git gcc libffi-dev python3-dev musl-dev openssl-dev
- npm install -qs
- npm run build
only:
- [email protected]/sickrage
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- sickrage/core/webserver/static/
review:docker:
stage: review_docker
dependencies:
- review:webpack
image:
name: docker:latest
entrypoint: ["/bin/sh", "-c"]
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://localhost:2375
DOCKER_TLS_CERTDIR: ""
services:
- docker:dind
script:
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_JOB_TOKEN}" "${CI_REGISTRY}"
- docker build --network host -t "${CI_REGISTRY_IMAGE}:latest" .
- docker tag "${CI_REGISTRY_IMAGE}:latest" "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
- test ! -z "${CI_COMMIT_TAG}" && docker push "${CI_REGISTRY_IMAGE}:latest"
- docker push "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
only:
- [email protected]/sickrage
cache:
key: ${CI_COMMIT_REF_SLUG}
review:deploy:
stage: review_deploy
dependencies:
- review:docker
image:
name: lachlanevenson/k8s-kubectl:latest
entrypoint: ["/bin/sh", "-c"]
script:
- kubectl create secret docker-registry gitlab-registry --namespace ${KUBE_NAMESPACE} --docker-server=${CI_REGISTRY} --docker-username=${CI_REGISTRY_USER} --docker-password=${CI_JOB_TOKEN} --docker-email=$GITLAB_USER_EMAIL --dry-run -o json | kubectl apply --namespace ${KUBE_NAMESPACE} -f -
- sed -i "s~__CI_REGISTRY_IMAGE__~${CI_REGISTRY_IMAGE}~" manifests/deployment.yaml
- sed -i "s/__VERSION__/${CI_COMMIT_REF_NAME}/" manifests/deployment.yaml manifests/ingress.yaml manifests/service.yaml
- sed -i "s/__CI_COMMIT_REF_SLUG__/${CI_COMMIT_REF_SLUG}/" manifests/deployment.yaml manifests/ingress.yaml manifests/service.yaml
- sed -i "s/__CI_ENVIRONMENT_SLUG__/${CI_ENVIRONMENT_SLUG}/" manifests/deployment.yaml manifests/ingress.yaml manifests/service.yaml
- sed -i "s/__KUBE_NAMESPACE__/${KUBE_NAMESPACE}/" manifests/deployment.yaml manifests/ingress.yaml manifests/service.yaml
- |
if kubectl apply -f manifests/deployment.yaml | grep -q unchanged; then
echo "=> Patching deployment to force image update."
kubectl patch -f manifests/deployment.yaml -p "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"ci-last-updated\":\"$(date +'%s')\"}}}}}"
else
echo "=> Deployment apply has changed the object, no need to force image update."
fi
- kubectl apply -f manifests/service.yaml || true
- kubectl apply -f manifests/ingress.yaml
- kubectl rollout status -f manifests/deployment.yaml
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://review.sickrage.ca/$CI_COMMIT_REF_SLUG
on_stop: review:stop
only:
- [email protected]/sickrage
review:stop:
stage: review_deploy
image:
name: lachlanevenson/k8s-kubectl:latest
entrypoint: ["/bin/sh", "-c"]
script:
# - wget -O /usr/bin/reg https://github.com/genuinetools/reg/releases/download/v0.13.0/reg-linux-amd64
# - chmod +x /usr/bin/reg
# - reg -r ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} rm ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
- kubectl delete ing -l ref=${CI_ENVIRONMENT_SLUG}
- kubectl delete all -l ref=${CI_ENVIRONMENT_SLUG}
variables:
GIT_STRATEGY: none
when: manual
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
only:
- [email protected]/sickrage
#review:webpack:
# stage: review_webpack
# image:
# name: nikolaik/python-nodejs:python3.7-nodejs10-alpine
# variables:
# NODE_ENV: "development"
# script:
# - apk add --no-cache git gcc libffi-dev python3-dev musl-dev openssl-dev
# - npm install -qs
# - npm run build
# only:
# - [email protected]/sickrage
# cache:
# key: ${CI_COMMIT_REF_SLUG}
# paths:
# - sickrage/core/webserver/static/
#
#review:docker:
# stage: review_docker
# dependencies:
# - review:webpack
# image:
# name: docker:latest
# entrypoint: ["/bin/sh", "-c"]
# variables:
# DOCKER_DRIVER: overlay2
# DOCKER_HOST: tcp://localhost:2375
# DOCKER_TLS_CERTDIR: ""
# services:
# - docker:dind
# script:
# - docker login -u "${CI_REGISTRY_USER}" -p "${CI_JOB_TOKEN}" "${CI_REGISTRY}"
# - docker build --network host -t "${CI_REGISTRY_IMAGE}:latest" .
# - docker tag "${CI_REGISTRY_IMAGE}:latest" "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
# - test ! -z "${CI_COMMIT_TAG}" && docker push "${CI_REGISTRY_IMAGE}:latest"
# - docker push "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
# only:
# - [email protected]/sickrage
# cache:
# key: ${CI_COMMIT_REF_SLUG}
#
#review:deploy:
# stage: review_deploy
# dependencies:
# - review:docker
# image:
# name: lachlanevenson/k8s-kubectl:latest
# entrypoint: ["/bin/sh", "-c"]
# script:
# - kubectl create secret docker-registry gitlab-registry --namespace ${KUBE_NAMESPACE} --docker-server=${CI_REGISTRY} --docker-username=${CI_REGISTRY_USER} --docker-password=${CI_JOB_TOKEN} --docker-email=$GITLAB_USER_EMAIL --dry-run -o json | kubectl apply --namespace ${KUBE_NAMESPACE} -f -
# - sed -i "s~__CI_REGISTRY_IMAGE__~${CI_REGISTRY_IMAGE}~" manifests/deployment.yaml
# - sed -i "s/__VERSION__/${CI_COMMIT_REF_NAME}/" manifests/deployment.yaml manifests/ingress.yaml manifests/service.yaml
# - sed -i "s/__CI_COMMIT_REF_SLUG__/${CI_COMMIT_REF_SLUG}/" manifests/deployment.yaml manifests/ingress.yaml manifests/service.yaml
# - sed -i "s/__CI_ENVIRONMENT_SLUG__/${CI_ENVIRONMENT_SLUG}/" manifests/deployment.yaml manifests/ingress.yaml manifests/service.yaml
# - sed -i "s/__KUBE_NAMESPACE__/${KUBE_NAMESPACE}/" manifests/deployment.yaml manifests/ingress.yaml manifests/service.yaml
# - |
# if kubectl apply -f manifests/deployment.yaml | grep -q unchanged; then
# echo "=> Patching deployment to force image update."
# kubectl patch -f manifests/deployment.yaml -p "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"ci-last-updated\":\"$(date +'%s')\"}}}}}"
# else
# echo "=> Deployment apply has changed the object, no need to force image update."
# fi
# - kubectl apply -f manifests/service.yaml || true
# - kubectl apply -f manifests/ingress.yaml
# - kubectl rollout status -f manifests/deployment.yaml
# environment:
# name: review/$CI_COMMIT_REF_NAME
# url: https://review.sickrage.ca/$CI_COMMIT_REF_SLUG
# on_stop: review:stop
# only:
# - [email protected]/sickrage
#
#review:stop:
# stage: review_deploy
# image:
# name: lachlanevenson/k8s-kubectl:latest
# entrypoint: ["/bin/sh", "-c"]
# script:
## - wget -O /usr/bin/reg https://github.com/genuinetools/reg/releases/download/v0.13.0/reg-linux-amd64
## - chmod +x /usr/bin/reg
## - reg -r ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} rm ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
# - kubectl delete ing -l ref=${CI_ENVIRONMENT_SLUG}
# - kubectl delete all -l ref=${CI_ENVIRONMENT_SLUG}
# variables:
# GIT_STRATEGY: none
# when: manual
# environment:
# name: review/$CI_COMMIT_REF_NAME
# action: stop
# only:
# - [email protected]/sickrage
release:build:master:
stage: release_build
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment