.gitlab-ci.yml 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
image: openshift/origin-cli

default:
    tags:
       - debian
    timeout: 1h 00m

stages:
    - build

variables:
    OPENSHIFT_SERVER: https://${OPENSHIFT_IP}:${OPENSHIFT_PORT}/
    OPENSHIFT_DOMAIN: apps.okd.aip.de
# Configure this variable in Secure Variables:
#OPENSHIFT_TOKEN:
#OPENSHIFT_PROJECT: python

.login_to_okd: &login_to_okd
    - oc login "$OPENSHIFT_SERVER" --token="$OPENSHIFT_TOKEN" --insecure-skip-tls-verify	
    - oc project "$CI_PROJECT_NAME-$CI_PROJECT_ID" 2> /dev/null || oc new-project "$CI_PROJECT_NAME-$CI_PROJECT_ID"

.build_image: &build_image
23 24
    - oc new-build --strategy=docker --binary --name "build-$APP" --to "$APP"
    - oc start-build build-$APP --from-dir=./docker/$APP --follow
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

build-pgapp:
    stage: build
    variables:
      APP: pgapp
      DOCKER_FILE: dockerfile
      APP_HOST: $CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$OPENSHIFT_DOMAIN
    before_script:
      - *login_to_okd
    script:
      - *build_image

build-pgdata:
    stage: build
    variables:
      APP: pgdata
      DOCKER_FILE: dockerfile
      APP_HOST: $CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$OPENSHIFT_DOMAIN
    before_script:
      - *login_to_okd
    script:
      - *build_image

build-wpdb:
    stage: build
    variables:
      APP: wpdb
      DOCKER_FILE: dockerfile
      APP_HOST: $CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$OPENSHIFT_DOMAIN
    before_script:
      - *login_to_okd
    script:
      - *build_image