Skip to content
Philip Giuliani edited this page Oct 17, 2016 · 2 revisions

If you would like to generate the swagger documentation when deploying with edeliver, you can add the following callback in .deliver/config (see edeliver hooks).

swagger_documentation() {
  status "Generating swagger documentation"

  __sync_remote "
    # runs the commands on the build host
    [ -f ~/.profile ] && source ~/.profile # load profile (optional)

    # fail if any command fails (recommended)
    set -e

    # enter the build directory on the build host (required)
    cd '$BUILD_AT'

    # run phoenix.swagger.generate
    APP='$APP' MIX_ENV='$TARGET_MIX_ENV' $MIX_CMD phoenix.swagger.generate $SILENCE

    # copy swagger.json to priv/static
    cp '$BUILD_AT/swagger.json' '$BUILD_AT/priv/static/'
  "
}

post_erlang_clean_compile() {
  swagger_documentation

  # phoenix digest code in case you want to generate it.
}
Clone this wiki locally