Деплой extjs приложения
Всем привет!
Знатоки и гуру ExtJS, подскажите, каким образом мне задеплоить мое созданное приложение в продакшн? Знаю, что есть у sencha cmd команда build production, но гугление пока не показало готового рецепта использования и как это все настраивается красиво в боевой среде. Что в конечном итоге получается? Как это деплоить автоматом? На другом проекте у меня просто развернута git-копия и через git pull я забираю нужные мне изменения. К тому же, если мне нужно будет что-то поменять "наживую", получается, необходимо будет еще Sencha CMD на linux-сервере поставить? :-? |
После sencha app build вы получаете папку production с файлами. Примерно такими:
resources\ app.js app.json index.html Перенесите их в то место где их может найти веб сервер. Используйте ссылку на индекс в браузере. |
С этим я разобрался. Встает вопрос синхронизации с git и автодеплоя. Сбилденное приложение падает во вложенную папку и непонятно как это использовать на боевом сервере.
Понятно, что можно постоянно по SFTP ручками копировать папку после каждого билда. Но неужели все так тут делают? :blink: |
В корне есть файл build.xml - там все для вас нужное можно организовать.
пример из моего.. давнего проекта.. много лишнего.. здесь копируются файлы по FTP, scp - закомментировал разберетесь.. <target name="-after-build" description="Copying scripts"> <if> <or> <equals arg1="${args.environment}" arg2="testing"/> <equals arg1="${args.environment}" arg2="production"/> </or> <then> <if> <equals arg1="${args.environment}" arg2="production"/> <then> <tstamp> <format property="THISYEAR" pattern="yyyy"/> </tstamp> <move file="${build.classes.file}" tofile="${build.classes.file}.tmp"/> <concat destfile="${build.classes.file}" encoding="UTF-8" outputencoding="UTF-8"> <header filtering="no" trimleading="yes"> /* * * Copyright (C) ${THISYEAR}. Все права защищены. * */ </header> <footer filtering="no" trimleading="yes"> /* * * [email]mail@mail.by[/email] * by N.S. * * (\ /) * (•.•) * (")(") * */ </footer> <fileset file="${build.classes.file}.tmp"/> </concat> <delete file="${build.classes.file}.tmp" /> <propertyfile file="app.props"> <entry key="build.number.prod" type="int" operation="+" value="1"/> <entry key="build.number.test" type="int" operation="+" value="0"/> </propertyfile> <property file="app.props"/> <replace file="${build.classes.file}" token="{VERSION_PRODUCTION}" value="${build.number.prod}" encoding="UTF-8"/> <replace file="${build.classes.file}" token="{VERSION_TESTING}" value="${build.number.test}" encoding="UTF-8"/> </then> </if> <if> <equals arg1="${args.environment}" arg2="testing"/> <then> <propertyfile file="app.props"> <entry key="build.number.prod" type="int" operation="+" value="0"/> <entry key="build.number.test" type="int" operation="+" value="1"/> </propertyfile> <property file="app.props"/> <replace file="${workspace.build.dir}/${args.environment}/${app.name}/${app.output.js}" token="{VERSION_PRODUCTION}" value="${build.number.prod}" encoding="UTF-8"/> <replace file="${workspace.build.dir}/${args.environment}/${app.name}/${app.output.js}" token="{VERSION_TESTING}" value="${build.number.test}" encoding="UTF-8"/> </then> </if> <x-echo message="**************"/> <x-echo message="* *"/> <x-echo message="* MESSAG *"/> <x-echo message="* *"/> <x-echo message="**************"/> <x-echo message="(*) Copying PHP scripts to ${workspace.build.dir}/${args.environment}/${app.name}"/> <copy overwrite="true" verbose="true" todir="${workspace.build.dir}/${args.environment}/${app.name}"> <fileset dir="${basedir}"> <include name="lib/**"/> </fileset> <fileset dir="${basedir}"> <include name="share/**"/> </fileset> <fileset dir="${basedir}"> <include name="vendor/**"/> </fileset> <fileset dir="${basedir}"> <include name="tmpl/**"/> </fileset> <fileset dir="${basedir}"> <include name="index.php"/> </fileset> <fileset dir="${basedir}"> <include name="bootstrap.php"/> </fileset> <fileset dir="${basedir}"> <include name=".htaccess"/> </fileset> </copy> <if> <equals arg1="${args.environment}" arg2="production"/> <then> <!-- <input message="Please enter SFTP username:" addproperty="scp.user" /> <input message="Please enter SFTP password:" addproperty="scp.password" /> --> <loadproperties srcFile="app.props"/> <if> <equals arg1="${ftp.upload}" arg2="1"/> <then> <taskdef name="ftp" classname="org.apache.tools.ant.taskdefs.optional.net.FTP"> <classpath> <pathelement location="${basedir}/jar/ant-commons-net.jar"/> <pathelement location="${basedir}/jar/commons-net-3.3.jar"/> </classpath> </taskdef> <x-echo message="(*) Copying files to ${args.environment} FTP server: ${ftp.server}${ftp.dir}"/> <trycatch property="error-prop" reference="error-ref"> <try> <ftp verbose="yes" depends="yes" passive="yes" server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}" remotedir="${ftp.dir}"> <fileset dir="${workspace.build.dir}/${args.environment}/${app.name}"/> </ftp> </try> <catch> <x-echo level="warning" message=" error..."/> <x-echo level="error" message=" error message: ${error-prop}"/> <!-- <property name="error-ref-prop" refid="error-ref" /> <x-echo level="error" message=" From reference: ${error-ref-prop}"/> --> </catch> </trycatch> </then> </if> <!-- <scp remoteTodir="${scp.user}@sftp.mysite.com:/path/to/myapp/dir" password="${scp.password}"> <fileset dir="${workspace.build.dir}/${args.environment}/${app.name}"/> </scp> --> </then> </if> <x-echo message=" -----------------------------------"/> <x-echo message="| |"/> <x-echo message="| Created build version - 1.0.${build.number.prod}.${build.number.test}"/> <x-echo message="| |"/> <x-echo message=" -----------------------------------"/> <x-echo message="(*) END"/> </then> </if> </target> |
Часовой пояс GMT +3, время: 23:58. |