Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.47 KiB
Newer Older
  • Learn to ignore specific revisions
  • default:
      image: python:3-slim
    
    stages:
    
      - build
      - publish
      - deploy
    
    test:
      stage: test
    
      image: 
        name: apache/airflow:2.1.2
    
        entrypoint: [""]
    
    Jedrzej Rybicki's avatar
    Jedrzej Rybicki committed
      before_script:
        - airflow db init
    
    Jedrzej Rybicki's avatar
    Jedrzej Rybicki committed
        - pip install -r requirements.txt
    
    Jedrzej Rybicki's avatar
    Jedrzej Rybicki committed
        - pip install nose==1.3.7
    
    Jedrzej Rybicki's avatar
    Jedrzej Rybicki committed
        - airflow connections add --conn-uri https://b2share-testing.fz-juelich.de/ default_b2share
    
       - ls 
       - pwd
       - cp dags/* /opt/airflow/dags/
    
    Jedrzej Rybicki's avatar
    Jedrzej Rybicki committed
       - airflow connections list
    
       - airflow dags test testdag 2021-08-18
    
    Jedrzej Rybicki's avatar
    Jedrzej Rybicki committed
       - nosetests
    
    deploy-test:
      stage: deploy
      environment: Testing
      only: 
    
      variables:
        OS_AUTH_TYPE: v3applicationcredential
        OS_AUTH_URL: https://hdf-cloud.fz-juelich.de:5000
        OS_IDENTITY_API_VERSION: 3
        OS_REGION_NAME: "HDFCloud"
        OS_INTERFACE: public
    
        FLOATING_IP: 134.94.199.220
    
      script:
        - echo "Starting the full testing deployment of airflows example."
        - pip install python-openstackclient
    
    Maria Petrova-El Sayed's avatar
    Maria Petrova-El Sayed committed
        - INSTANCE_ID=`openstack server create -f value -c id --prefix IMAGE_ --flavor m2 --image 149a65b5-aeb8-499f-aaa6-ec966bd28dd6 --user-data scripts/cloudinit.yml --security-group ssh --security-group airflows --security-group www --security-group https airflow-testing`
    
        - while [ "`openstack server show $INSTANCE_ID -c addresses -f value`" = "{}" ]; do sleep 5; done # wait until an address is available to attach the floating ip
        - openstack server add floating ip $INSTANCE_ID $FLOATING_IP
        - echo "Done"