Gitlab Community Edition Instance

Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.95 KiB
Newer Older
# tempaltes
.install_template: &installation
  script:
    # wait for service container
    - while [ $(curl --head --silent http://$TARGET | grep -c "200 OK") == 0 ]; do sleep 2s; done
    # upload package
    - 'curl -X PUT -H "Content-Type: application/zip" --data-binary @$(ls build/*.xar) "http://admin:@$TARGET/exist/rest/db/openapi.xar"'
    # install package
    - 'curl -X GET "http://admin:@$TARGET/exist/rest/db/?_query=repo:install-and-deploy-from-db(''/db/openapi.xar'')"'
    # check availabilty
    # for debug use - 'curl --silent "http://$TARGET/exist/apps/openapi/openapi.json"'
    - 'curl --silent "http://$TARGET/exist/apps/openapi/index.html" | grep "Swagger UI for OpenAPI for RESTXQ"' # swagger available
    - 'curl --silent "http://$TARGET/exist/apps/openapi/openapi.json" | grep "OpenAPI for RESTXQ"' # openapi.json available
  timeout: 5 minutes

# main CI instructions
Mathias Goebel's avatar
Mathias Goebel committed
image: docker.gitlab.gwdg.de/subugoe/openapi4restxq:latest

stages:
  - build
  - test
  - deploy

build-develop:
  except:
Mathias Goebel's avatar
Mathias Goebel committed
      - main
Mathias Goebel's avatar
Mathias Goebel committed
      - tags
  stage: build
  script:
    - npm install
Mathias Goebel's avatar
Mathias Goebel committed
  artifacts:
    paths:
      - build/*.xar

Mathias Goebel's avatar
Mathias Goebel committed
build-main:
Mathias Goebel's avatar
Mathias Goebel committed
  only:
Mathias Goebel's avatar
Mathias Goebel committed
      - main
Mathias Goebel's avatar
Mathias Goebel committed
  stage: build
  script:
Mathias Goebel's avatar
Mathias Goebel committed
    - cp main.build.properties local.build.properties
    - npm install
Mathias Goebel's avatar
Mathias Goebel committed
    - ant test
  artifacts:
    paths:
      - build/*.xar
      - test/

installation-exist:
Mathias Goebel's avatar
Mathias Goebel committed
  except:
      - tags
  stage: test
  services:
    - name: existdb/existdb:latest
      alias: existdb
  variables:
    TARGET: "existdb:8080"
  <<: *installation


installation-fusion:
  stage: test
  except:
    - tags
  services:
    - name: repo.evolvedbinary.com:9443/evolvedbinary/fusiondb-server:latest
      alias: fusiondb
  variables:
    TARGET: "fusiondb:4059"
  <<: *installation

Mathias Goebel's avatar
Mathias Goebel committed

upload:
  only:
Mathias Goebel's avatar
Mathias Goebel committed
      - main
Mathias Goebel's avatar
Mathias Goebel committed
      - develop
  except:
      - tags
  stage: deploy
  script:
    - FILENAME=$(ls build/*.xar)
    - curl -u ci:${EXIST_UPLOAD_PW} -X POST -F file=@${FILENAME} https://ci.de.dariah.eu/exist-upload