Changeset - 3d5ed5c5160a
[Not reviewed]
0 2 0
James Polley - 6 years ago 2018-06-24 04:32:33
jp@jamezpolley.com
Turn review jobs back on

Use a new "rego-review" namespace to not interfere with the dev instance.
2 files changed with 33 insertions and 33 deletions:
0 comments (0 inline, 0 general)
.gitlab-ci.yml
Show inline comments
...
 
@@ -63,81 +63,81 @@ build_2019_dev_image:
 
    - docker push "${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA
 
    - docker push "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA
 
    - docker tag "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA "${CONTAINER_IMAGE_2019}"_dev:latest
 
    - docker tag "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_REF_SLUG
 
    - docker push "${CONTAINER_IMAGE_2019}"_dev:latest
 
    - docker push "${CONTAINER_IMAGE_2019}"_dev:${CI_COMMIT_REF_SLUG}
 
  except:
 
    - master
 

	
 
k8s-2019_dev-deploy:
 
  image: google/cloud-sdk
 
  stage: deploy
 
  script:
 
  - echo "${CA_CERT}" > cert.crt
 
  - kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
 
  - kubectl config set-context cluster --cluster=cluster --namespace=rego-dev --user=gitlab-sa
 
  - kubectl config use-context cluster
 
  - kubectl --token "${GL_KUBE_TOKEN}" set image deployment/symposion-app symposion-app="${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA
 
  only:
 
  - dev/2019
 
  environment:
 
    name: 2019/dev
 
    url: https://dev.lca2019.org
 

	
 
# k8s-2019_dev_review-deploy:
 
#   image: google/cloud-sdk
 
#   stage: deploy
 
#   script:
 
#   - echo "${CA_CERT}" > cert.crt
 
#   - kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
 
#   - kubectl config set-context cluster --cluster=cluster --namespace=rego-dev --user=gitlab-sa
 
#   - kubectl config use-context cluster
 
#   - kubectl --token "${GL_KUBE_TOKEN}" apply -f k8s/deployment.json
 
#   - kubectl --token "${GL_KUBE_TOKEN}" describe ingress | grep "${CI_COMMIT_REF_SLUG}" || kubectl --token "${GL_KUBE_TOKEN}" patch ingress symposion-app-ingress -p "$(cat k8s/ingress-patch.json)" --type json
 
#   only:
 
#   - /^dev\/.*$/
 
#   environment:
 
#     name: 2019/dev/${CI_COMMIT_REF_SLUG}
 
#     url: https://${CI_COMMIT_REF_SLUG}.dev.lca2019.org
 
#     on_stop: k8s-2019_dev_review-stop-deploy
 
k8s-2019_dev_review-deploy:
 
  image: google/cloud-sdk
 
  stage: deploy
 
  script:
 
  - echo "${CA_CERT}" > cert.crt
 
  - kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
 
  - kubectl config set-context cluster --cluster=cluster --namespace=rego-review --user=rego-dev/gitlab-sa
 
  - kubectl config use-context cluster
 
  - kubectl --token "${GL_KUBE_TOKEN}" apply -f k8s/deployment.json
 
  - kubectl --token "${GL_KUBE_TOKEN}" describe ingress | grep "${CI_COMMIT_REF_SLUG}" || kubectl --token "${GL_KUBE_TOKEN}" patch ingress symposion-app-ingress -p "$(cat k8s/ingress-patch.json)" --type json
 
  only:
 
  - /^dev\/.*$/
 
  environment:
 
    name: 2019/dev/${CI_COMMIT_REF_SLUG}
 
    url: https://${CI_COMMIT_REF_SLUG}.dev.lca2019.org
 
    on_stop: k8s-2019_dev_review-stop-deploy
 

	
 
# k8s-2019_dev_review-stop-deploy:
 
#   image: google/cloud-sdk
 
#   stage: deploy
 
#   script:
 
#   - echo "${CA_CERT}" > cert.crt
 
#   - kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
 
#   - kubectl config set-context cluster --cluster=cluster --namespace=rego-dev --user=gitlab-sa
 
#   - kubectl config use-context cluster
 
#   - kubectl --token "${GL_KUBE_TOKEN}" delete -f k8s/deployment.json
 
#   only:
 
#   - /^dev\/.*$/
 
#   when: manual
 
#   environment:
 
#     name: 2019/dev/${CI_COMMIT_REF_SLUG}
 
#     url: https://${CI_COMMIT_REF_SLUG}.dev.lca2019.org
 
#     action: stop
 
k8s-2019_dev_review-stop-deploy:
 
  image: google/cloud-sdk
 
  stage: deploy
 
  script:
 
  - echo "${CA_CERT}" > cert.crt
 
  - kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
 
  - kubectl config set-context cluster --cluster=cluster --namespace=rego-review --user=rego-dev/gitlab-sa
 
  - kubectl config use-context cluster
 
  - kubectl --token "${GL_KUBE_TOKEN}" delete -f k8s/deployment.json
 
  only:
 
  - /^dev\/.*$/
 
  when: manual
 
  environment:
 
    name: 2019/dev/${CI_COMMIT_REF_SLUG}
 
    url: https://${CI_COMMIT_REF_SLUG}.dev.lca2019.org
 
    action: stop
 

	
 
k8s-2019_staging-deploy:
 
  image: google/cloud-sdk
 
  stage: deploy
 
  script:
 
  - echo "${CA_CERT}" > cert.crt
 
  - kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
 
  - kubectl config set-context cluster --cluster=cluster --namespace=lca2019-staging --user=gitlab-ci
 
  - kubectl config use-context cluster
 
  - kubectl --token "${GL_KUBE_TOKEN}" set image deployment/symposion-app symposion-app="${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA
 
  when: manual
 
  only:
 
  - dev/2019
 
  environment:
 
    name: 2019/staging
 
    url: https://staging.lca2019.org
 

	
 
.docs_template: &sphinx
 
  image: alpine
 
  script:
 
  - apk --no-cache add py2-pip python-dev make
 
  - pip install sphinx
 
  - cd docs
 
  - make html
k8s/deployment_template.jsonnet
Show inline comments
 
function (slug) {
 
  
 
  local app = "symposion-app-" + slug,
 
  local namespace = "rego-dev",
 
  local namespace = "rego-review",
 
  local domain = slug + ".dev.lca2019.org",
 
  
 
  "deployment.json":
 
    {
 
      "apiVersion": "v1",
 
      "items": [
 
        {
 
          "apiVersion": "v1",
 
          "kind": "Service",
 
          "metadata": {
 
            "labels": {
 
              "app": "symposion-app"
 
            },
 
            "name": app,
 
            "namespace": namespace
 
          },
 
          "spec": {
 
            "ports": [
 
              {
 
                "port": 8000,
 
                "protocol": "TCP",
 
                "targetPort": 8000
 
              }
 
            ],
0 comments (0 inline, 0 general)