<commit_before>box: golang

dev:
  steps:
    - script:
      name: link to source files
      code: |
        export IMPORT_PATH=$GOPATH/src/bitbucket.org/jawobar/webhook-devourer
        mkdir -p $(dirname $IMPORT_PATH)
        ln -s $WERCKER_SOURCE_DIR $IMPORT_PATH
    - internal/watch:
        code: |
          go get
          go build
          ./source -config config.yml
        reload: true
    - internal/shell

build:
  steps:
    - wercker/setup-go-workspace:
      package-dir: bitbucket.org/jawobar/webhook-devourer
    - script:
      name: get dependencies
      code: go get -v ./...
    - script:
      name: build executable
      code: go build -o webhooks -a -v
    - script:
      name: move executable
      code: mv $GOPATH/bin/* $WERCKER_OUTPUT_DIR

deploy:
  steps:
    - script:
      name: list files
      code: ls -l ./<commit_msg>Deploy pipeline added<commit_after>box: golang

dev:
  steps:
    - script:
      name: link to source files
      code: |
        export IMPORT_PATH=$GOPATH/src/bitbucket.org/jawobar/webhook-devourer
        mkdir -p $(dirname $IMPORT_PATH)
        ln -s $WERCKER_SOURCE_DIR $IMPORT_PATH
    - internal/watch:
        code: |
          go get
          go build
          ./source -config config.yml
        reload: true
    - internal/shell

build:
  steps:
    - wercker/setup-go-workspace:
      package-dir: bitbucket.org/jawobar/webhook-devourer
    - script:
      name: get dependencies
      code: go get -v ./...
    - script:
      name: build executable
      code: go build -a -v
    - script:
      name: move executable
      code: |
        mv $GOPATH/bin/webhook-devourer $WERCKER_OUTPUT_DIR/webhooks
        ls -la $WERCKER_OUTPUT_DIR

deploy:
  steps:
    - add-to-known_hosts:
      hostname: jawobar.eu
    - mktemp:
      envvar: PRIVATE_KEY_PATH
    - create-file:
      filename: $PRIVATE_KEY_PATH
      content: $SSH_KEY_PRIVATE
      overwrite: true
      hide-from-log: true
    - script:
      name: stop application
      code: ssh -i $PRIVATE_KEY_PATH -l $USER -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no jawobar.eu sudo stop webhooks || true
    - script:
      name: transfer application
      code: |
        pwd
        ls -la
        scp -i $PRIVATE_KEY_PATH -o StrictHostKeyChecking=no -o UserKnownHostsFile=no webhooks $<EMAIL>:/usr/local/bin
    - script:
      name: set application's permissions
      code: ssh -i $PRIVATE_KEY_PATH -l $USER -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no jawobar.eu chmod 4650 /usr/local/bin/webhooks
    - script:
      name: start application
      code: ssh -i $PRIVATE_KEY_PATH -l $USER -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no jawobar.eu sudo start webhooks
{'fraction_non_alphanumeric': 0.09501274117218785, 'fraction_numerical': 0.0014561339643247178, 'mean_word_length': 2.1085972850678734, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5162219', 'n_tokens_mistral': 955, 'n_tokens_neox': 927, 'n_words': 232}