version: 0.2 env: variables: RESULT_BUCKET: RESULT-BUCKET-NAME-HERE # SOURCE_BUCKET: ohdsi-rstudio # TEMPLATE_NAME: 00-master-ohdsi.yaml SOURCE_BUCKET: SOURCE-BUCKET-NAME-HERE TEMPLATE_NAME: TEMPLATE-NAME-HERE TOPIC_ARN: TOPIC-ARN_HERE # These parameter is specifc to the test script # If testing multiple regions add another # - python3 test-scripts/tests.py $EB_ENDPOINT us-east-1 $USER $PASSW $RESULT_BUCKET # command in the build section EB_ENDPOINT: OHDSI-EB-ENPOINT-HERE REGION: REGION-TO-TEST-HERE secrets-manager: AWSid: TestPipelineAccessKey:id AWSkey: TestPipelineAccessKey:key USERN: SECRET-NAME-HERE:USERNAME-KEY-HERE PASSW: SECRET-NAME-HERE:PASSWORD-KEY-HERE phases: install: runtime-versions: python: 3.7 commands: # install dependencies - echo install phase started on `date` - python --version - 'curl -O https://bootstrap.pypa.io/get-pip.py' - python3 get-pip.py - pip install --upgrade pip - pip install -U selenium - pip install boto3 - pip install webdriver_manager - pip install beautifulsoup4 - pip install pyyaml - aws configure set aws_access_key_id $AWSid - aws configure set aws_secret_access_key $AWSkey - aws configure set default.region us-east-1 - cd /tmp/ - wget https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip - unzip chromedriver_linux64.zip - mv chromedriver /usr/bin/chromedriver - touch /etc/yum.repos.d/google-chrome.repo - echo -e "[google-chrome]\nname=google-chrome\nbaseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\ngpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub" >> /etc/yum.repos.d/google-chrome.repo - touch /etc/yum.repos.d/centos.repo - echo -e "[CentOS-base]\nname=CentOS-6 - Base\nmirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os\ngpgcheck=1\ngpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6\n\n" >> /etc/yum.repos.d/centos.repo - echo -e "#released updates\n[CentOS-updates]\nname=CentOS-6 - Updates\nmirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates\ngpgcheck=1\ngpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6\n\n" >> /etc/yum.repos.d/centos.repo - echo -e "#additional packages that may be useful\n[CentOS-extras]\nname=CentOS-6 - Extras\nmirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=extras\ngpgcheck=1\ngpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6\n" >> /etc/yum.repos.d/centos.repo - yum install -y google-chrome-stable - cd $CODEBUILD_SRC_DIR - pip3 install taskcat # grab the template from the source bucket - mkdir templates - aws s3 cp s3://$SOURCE_BUCKET/$TEMPLATE_NAME templates/$TEMPLATE_NAME build: commands: - echo Build phase started on `date` # inject the username and password into the taskcat file - python3 insert_vars.py .taskcat.yml $USERN $PASSW # run taskcat without deleting - taskcat test run --no-delete - taskcat test list # wait to make sure stack resources are created - sleep 120 # test the cloudformation stack - python3 test-scripts/tests.py $EB_ENDPOINT $REGION $USERN $PASSW $RESULT_BUCKET - ls post_build: commands: - echo post build phase started on `date`; # Delete the stack if all tests ran successfully - if [ $CODEBUILD_BUILD_SUCCEEDING -eq 1 ]; then python3 test-scripts/get_test_results.py $REGION odshi-on-aws $TOPIC_ARN $RESULT_BUCKET; taskcat test clean ALL; fi - aws s3 cp --recursive --acl public-read ./taskcat_outputs s3://$RESULT_BUCKET