<commit_before>box: ubuntu
build:
  steps:
    - script:
        name: initialize
        code: |
          export DEBIAN_FRONTEND=noninteractive
          apt-get update
          apt-get install -y python-pip libffi-dev libssl-dev
          pip install azure-cli
          mkdir output
    - script:
        name: parepare webapp 
        code: |
          tar zcf output/webapp.tar.gz --exclude=.gitignore webapp
    - script:
        name: parepare ansible 
        code: |
          sed -i \
            -e "s:@AZURE_STORAGE_ACCOUNT@:$AZURE_STORAGE_ACCOUNT:g" \
            -e "s:@CONTAINER_NAME@:$WERCKER_GIT_COMMIT:g" \
            ansible/playbook/roles/app/tasks//main.yml
          tar zcf output/ansible.tar.gz ansible
    - script:
        name: prepare azure template
        code: |
          sed \
            -e "s:@AZURE_STORAGE_ACCOUNT@:$AZURE_STORAGE_ACCOUNT:g" \
            -e "s:@CONTAINER_NAME@:$WERCKER_GIT_COMMIT:g" \
            azure/azuredeploy.json > output/azuredeploy.json
    - script:
        name: upload blob
        code: |
          az storage container create --public-access blob --name "$WERCKER_GIT_COMMIT"
          cd output
          for file in * ; do
              az storage blob upload --file $file --container-name "$WERCKER_GIT_COMMIT" --name $file
          done<commit_msg>Set Content-Type to azuredeploy.json<commit_after>box: ubuntu
build:
  steps:
    - script:
        name: initialize
        code: |
          export DEBIAN_FRONTEND=noninteractive
          apt-get update
          apt-get install -y python-pip libffi-dev libssl-dev
          pip install azure-cli
          mkdir output
    - script:
        name: parepare webapp 
        code: |
          tar zcf output/webapp.tar.gz --exclude=.gitignore webapp
    - script:
        name: parepare ansible 
        code: |
          sed -i \
            -e "s:@AZURE_STORAGE_ACCOUNT@:$AZURE_STORAGE_ACCOUNT:g" \
            -e "s:@CONTAINER_NAME@:$WERCKER_GIT_COMMIT:g" \
            ansible/playbook/roles/app/tasks//main.yml
          tar zcf output/ansible.tar.gz ansible
    - script:
        name: prepare azure template
        code: |
          sed \
            -e "s:@AZURE_STORAGE_ACCOUNT@:$AZURE_STORAGE_ACCOUNT:g" \
            -e "s:@CONTAINER_NAME@:$WERCKER_GIT_COMMIT:g" \
            azure/azuredeploy.json > output/azuredeploy.json
    - script:
        name: upload blob
        code: |
          az storage container create --public-access blob --name "$WERCKER_GIT_COMMIT"
          cd output
          az storage blob upload --file webapp.tar.gz --container-name "$WERCKER_GIT_COMMIT" --name webapp.tar.gz
          az storage blob upload --file ansible.tar.gz --container-name "$WERCKER_GIT_COMMIT" --name ansible.tar.gz
          az storage blob upload --file azuredeploy.json --container-name "$WERCKER_GIT_COMMIT" --name azuredeploy.json --content-type application/json
{'fraction_non_alphanumeric': 0.09762805087658989, 'fraction_numerical': 0.0, 'mean_word_length': 1.8669950738916257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5776502', 'n_tokens_mistral': 975, 'n_tokens_neox': 952, 'n_words': 203}