Commit 74d73a02 authored by Jørn Åne de Jong's avatar Jørn Åne de Jong
Browse files

Try re-importing hello-world so we get builds for branches

parent 98dfdf1e
Pipeline #31782 failed with stages
in 49 seconds
image: registry.uninett.no/asm/kubernetes-deploy:v0.22
include:
- project: 'asm/gitlab-ci-helpers'
file: '/gitlab-ci-helpers.yml'
variables:
KUBE_PROD_DOMAIN: cat_eduroam_no.paas2.uninett.no
KUBE_TEST_ID: cat
HTTP_PORT: '80' # The port number of the web server.
REPLICAS: '2'
REPLICAS: '1'
stages:
- build
- test
- review
- staging
- production
build:
variables:
GIT_SUBMODULE_STRATEGY: recursive
extends: .docker-build
stage: build
script:
- build
only:
- branches
imagescan:
extends: .imagescan
stage: test
only:
- branches
production:
extends: .production
stage: production
variables:
CI_ENVIRONMENT_URL: $KUBE_PROD_URL
REPLICAS: "2"
script:
- deploy kubernetes.yaml
environment:
name: production
url: $KUBE_PROD_URL
when: manual
only:
- master
- deploy deployment.yaml
staging:
extends: .staging
stage: staging
variables:
CI_ENVIRONMENT_URL: $KUBE_STAGING_URL
REPLICAS: '1'
script:
- deploy kubernetes.yaml
environment:
name: staging
url: $KUBE_STAGING_URL
only:
- master
- deploy deployment.yaml
review:
extends: .review
stage: review
script:
- deploy deployment.yaml
stop_review:
extends: .stop_review
stage: review
......@@ -3,6 +3,9 @@ kind: Deployment
metadata:
name: $CI_ENVIRONMENT_SLUG
namespace: $KUBE_NAMESPACE
annotations:
app.gitlab.com/env: $CI_ENVIRONMENT_SLUG
app.gitlab.com/app: $CI_PROJECT_PATH_SLUG
labels:
app: $CI_ENVIRONMENT_SLUG
pipeline_id: "$CI_PIPELINE_ID"
......@@ -14,6 +17,9 @@ spec:
app: $CI_ENVIRONMENT_SLUG
template:
metadata:
annotations:
app.gitlab.com/env: $CI_ENVIRONMENT_SLUG
app.gitlab.com/app: $CI_PROJECT_PATH_SLUG
labels:
name: $CI_ENVIRONMENT_SLUG
app: $CI_ENVIRONMENT_SLUG
......@@ -21,12 +27,6 @@ spec:
containers:
- name: app
image: $CI_REGISTRY_IMAGE:$CI_REGISTRY_TAG
imagePullPolicy: Always
resources:
limits:
memory: 500Mi
requests:
memory: 300Mi
ports:
- name: web
containerPort: $HTTP_PORT
......@@ -42,3 +42,16 @@ spec:
port: $HTTP_PORT
initialDelaySeconds: 5
timeoutSeconds: 15
lifecycle:
preStop: # Give ingress container time to stop sending requests to this container during shutdown.
exec:
command: ['/bin/sleep', '15']
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
name: $CI_ENVIRONMENT_SLUG
topologyKey: failure-domain.beta.kubernetes.io/zone
weight: 10
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