<commit_before>sudo: false
language: cpp
addons:
  apt:
    packages:
    - python-serial
    - srecord
cache:
  directories:
    - cache
before_install:
- cat build.config
- export X_EMAIL=$(grep -E 'email=(.*)' build.config | cut -c 7-)
- export X_BRANCH=$(grep -E 'branch=(.*)' build.config | cut -c 8-)
- export X_MODULES=$(grep -E 'modules=(.*)' build.config | cut -c 9-)
- export X_U8G_FONTS=$(grep -E 'u8g-fonts=(.*)' build.config | cut -c 11-)
- export X_SSL_ENABLED=$(grep -E 'ssl-enabled=(.*)' build.config | cut -c 13-)
- export X_DEBUG_ENABLED=$(grep -E 'debug-enabled=(.*)' build.config | cut -c 15-)
# count ',' in the string and add +1
- export X_NUMBER_OF_MODULES=$((`echo $X_MODULES | tr -d -c ',' | wc -m`+1))
- env | grep 'X_'

- wget -d -v 'http://nodemcu-build.com/hook.php?event=start&recipient='${X_EMAIL/+/%2B}
- git clone --depth=1 --branch=$X_BRANCH git://github.com/nodemcu/nodemcu-firmware.git nodemcu-firmware

# dig in and modify those config files
- cd nodemcu-firmware/app/include

# replace modules in user_modules.h by the selected ones
- bash $TRAVIS_BUILD_DIR/set-modules.sh
# comment the SSL flag in user_config.h if not enabled
- bash $TRAVIS_BUILD_DIR/set-ssl.sh
# replace fonts in u8g_config.h by the selected ones
- bash $TRAVIS_BUILD_DIR/set-fonts.sh
# replace version strings in user_version.h
- bash $TRAVIS_BUILD_DIR/set-version.sh
# set the NODE_DEBUG and COAP_DEBUG flags in user_config.h
- bash $TRAVIS_BUILD_DIR/set-debug.sh

- cat user_modules.h
- cat user_config.h
- cat u8g_config.h
- cat user_version.h
# back to where we came from
- cd $TRAVIS_BUILD_DIR

- cd nodemcu-firmware
- ls -altr
install:
- tar -zxvf tools/esp-open-sdk.tar.gz
- export PATH=$PATH:$PWD/esp-open-sdk/sdk:$PWD/esp-open-sdk/xtensa-lx106-elf/bin
script:
- make all
- cd bin/
- timestamp=$(date "+%Y-%m-%d-%H-%M-%S")
- base_file_name="nodemcu-"$X_BRANCH"-"$X_NUMBER_OF_MODULES"-modules-"$timestamp
- file_name_float=$base_file_name"-float.bin"
- srec_cat  -output ${file_name_float} -binary 0x00000.bin -binary -fill 0xff 0x00000 0x10000 0x10000.bin -binary -offset 0x10000
- cd ../
- make clean
- make EXTRA_CCFLAGS="-DLUA_NUMBER_INTEGRAL"
- cd bin/
- file_name_integer=$base_file_name"-integer.bin"
- srec_cat -output ${file_name_integer} -binary 0x00000.bin -binary -fill 0xff 0x00000 0x10000 0x10000.bin -binary -offset 0x10000

after_success:
- cd $TRAVIS_BUILD_DIR
- pwd
- cp "$TRAVIS_BUILD_DIR/nodemcu-firmware/bin/${file_name_float}" .
- cp "$TRAVIS_BUILD_DIR/nodemcu-firmware/bin/${file_name_integer}" .
- rm -fr "$TRAVIS_BUILD_DIR/nodemcu-firmware"
- ls -al
- curl -T "{${file_name_float},${file_name_integer}}" -u ${FTP_USER}:${FTP_PASSWORD} --ftp-ssl -k ftp://192.168.3.11
- wget -d -v 'http://nodemcu-build.com/hook.php?event=success&recipient='${X_EMAIL/+/%2B}'&branch='$X_BRANCH'&modules='$X_MODULES'&artifacts='${file_name_float},${file_name_integer}

env:
  global:
    secure: "<KEY>

notifications:
  email:
    recipients:
      - <EMAIL>
    on_success: never
    on_failure: always
  webhooks:
      urls:
        - http://nodemcu-build.com/hook.php?event=failure&recipient=${X_EMAIL/+/%2B}
      on_success: never
      on_failure: always
      on_start: never

branches:
  only:
    - builds
    - master
<commit_msg>Need to replace _all_ '+' signs not just the first<commit_after>sudo: false
language: cpp
addons:
  apt:
    packages:
    - python-serial
    - srecord
cache:
  directories:
    - cache
before_install:
- cat build.config
- export X_EMAIL=$(grep -E 'email=(.*)' build.config | cut -c 7-)
- export X_BRANCH=$(grep -E 'branch=(.*)' build.config | cut -c 8-)
- export X_MODULES=$(grep -E 'modules=(.*)' build.config | cut -c 9-)
- export X_U8G_FONTS=$(grep -E 'u8g-fonts=(.*)' build.config | cut -c 11-)
- export X_SSL_ENABLED=$(grep -E 'ssl-enabled=(.*)' build.config | cut -c 13-)
- export X_DEBUG_ENABLED=$(grep -E 'debug-enabled=(.*)' build.config | cut -c 15-)
# count ',' in the string and add +1
- export X_NUMBER_OF_MODULES=$((`echo $X_MODULES | tr -d -c ',' | wc -m`+1))
- env | grep 'X_'

- wget -d -v 'http://nodemcu-build.com/hook.php?event=start&recipient='${X_EMAIL//+/%2B}
- git clone --depth=1 --branch=$X_BRANCH git://github.com/nodemcu/nodemcu-firmware.git nodemcu-firmware

# dig in and modify those config files
- cd nodemcu-firmware/app/include

# replace modules in user_modules.h by the selected ones
- bash $TRAVIS_BUILD_DIR/set-modules.sh
# comment the SSL flag in user_config.h if not enabled
- bash $TRAVIS_BUILD_DIR/set-ssl.sh
# replace fonts in u8g_config.h by the selected ones
- bash $TRAVIS_BUILD_DIR/set-fonts.sh
# replace version strings in user_version.h
- bash $TRAVIS_BUILD_DIR/set-version.sh
# set the NODE_DEBUG and COAP_DEBUG flags in user_config.h
- bash $TRAVIS_BUILD_DIR/set-debug.sh

- cat user_modules.h
- cat user_config.h
- cat u8g_config.h
- cat user_version.h
# back to where we came from
- cd $TRAVIS_BUILD_DIR

- cd nodemcu-firmware
- ls -altr
install:
- tar -zxvf tools/esp-open-sdk.tar.gz
- export PATH=$PATH:$PWD/esp-open-sdk/sdk:$PWD/esp-open-sdk/xtensa-lx106-elf/bin
script:
- make all
- cd bin/
- timestamp=$(date "+%Y-%m-%d-%H-%M-%S")
- base_file_name="nodemcu-"$X_BRANCH"-"$X_NUMBER_OF_MODULES"-modules-"$timestamp
- file_name_float=$base_file_name"-float.bin"
- srec_cat  -output ${file_name_float} -binary 0x00000.bin -binary -fill 0xff 0x00000 0x10000 0x10000.bin -binary -offset 0x10000
- cd ../
- make clean
- make EXTRA_CCFLAGS="-DLUA_NUMBER_INTEGRAL"
- cd bin/
- file_name_integer=$base_file_name"-integer.bin"
- srec_cat -output ${file_name_integer} -binary 0x00000.bin -binary -fill 0xff 0x00000 0x10000 0x10000.bin -binary -offset 0x10000

after_success:
- cd $TRAVIS_BUILD_DIR
- pwd
- cp "$TRAVIS_BUILD_DIR/nodemcu-firmware/bin/${file_name_float}" .
- cp "$TRAVIS_BUILD_DIR/nodemcu-firmware/bin/${file_name_integer}" .
- rm -fr "$TRAVIS_BUILD_DIR/nodemcu-firmware"
- ls -al
- curl -T "{${file_name_float},${file_name_integer}}" -u ${FTP_USER}:${FTP_PASSWORD} --ftp-ssl -k ftp://192.168.3.11
- wget -d -v 'http://nodemcu-build.com/hook.php?event=success&recipient='${X_EMAIL//+/%2B}'&branch='$X_BRANCH'&modules='$X_MODULES'&artifacts='${file_name_float},${file_name_integer}

env:
  global:
    secure: "<KEY>

notifications:
  email:
    recipients:
      - <EMAIL>
    on_success: never
    on_failure: always
  webhooks:
      urls:
        - http://nodemcu-build.com/hook.php?event=failure&recipient=${X_EMAIL//+/%2B}
      on_success: never
      on_failure: always
      on_start: never

branches:
  only:
    - builds
    - master

{'fraction_non_alphanumeric': 0.15712545676004872, 'fraction_numerical': 0.028319123020706456, 'mean_word_length': 3.7774545454545456, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '283396', 'n_tokens_mistral': 2785, 'n_tokens_neox': 2601, 'n_words': 546}