Skip to content

Commit

Permalink
Melhorias no deploy por Docker.
Browse files Browse the repository at this point in the history
  • Loading branch information
Titan Auto-Deploy Script committed Oct 22, 2021
1 parent 23c46a0 commit 21358b0
Show file tree
Hide file tree
Showing 18 changed files with 536 additions and 531 deletions.
5 changes: 5 additions & 0 deletions .env.ci.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
COMPOSE_PROJECT_NAME=your_instance_name
COMPOSE_PROFILES=development
ENVIRONMENT=development
PORT=8090
DB=5433
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
vendor
.env
.env.ci
.env.backup
log
30 changes: 10 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,29 @@ Titan was developed and is maintained by the partnership between the [Software E
Getting Started
---------------

To create your project, use [Composer](https://getcomposer.org):
To create your project, use [PHP Composer](https://getcomposer.org):

```bash
php composer.phar create-project titan-framework/instance path/to/local/folder
```

After install, start [Vagrant](https://vagrantup.com) box to run your application. For this, install first [VirtualBox](https://www.virtualbox.org/wiki/Downloads) with it's Extension Pack.
Access the instance folder, copy the environment configuration files and change them at your convenience:
- ```.env.example``` » ```.env```; and
- ```.env.ci.example``` » ```.env.ci```.

**Warning!** Since version 6.0, the VirtualBox Guest Additions does not works properly anymore. To fix this issue, has a script `vagrant.sh` that need to run before `vagrant up` command.
Install [Docker](https://www.docker.com/). Then, run:

```bash
cd path/to/local/folder
./vagrant.sh
vagrant up
```

Alternatively, you can run your application as a [Docker](https://docker.com) container:

```bash
cd path/to/local/folder
docker-compose up -d
env $(cat .env.ci) docker-compose up --build --force-recreate
```

In Vagrant (recomended to **development** environments) your Titan instance will running at **http://localhost:8090**. To access, use "**admin**" as login and password. You can access shell using SSH at localhost:2222. All e-mail messages is getted by [MailHog](https://github.com/mailhog/MailHog), and you can access at **http://localhost:8025**. Now, you can modify the base-code to implement your requirements.
By default, your Titan instance will running at **http://localhost:8090**. To login, use "**admin**" as username and password.

In Docker (recomended to **test**, **homologation** and **production** environments) edit ```docker-compose.yml``` file in root directory to set correct ports for your infrastructure.
All e-mail messages is getted by [MailHog](https://github.com/mailhog/MailHog), and you can access at **http://localhost:8025**.

Now, you can modify the base-code to implement your requirements.

More Information
----------------

Read [official documentation](http://www.titanframework.com/docs/preface/) and [Titan Cookbook](https://github.com/titan-framework/docs/raw/master/Cookbook.pdf) (*in portuguese*) are the best ways to start using it. Access our [mailing list](https://groups.google.com/forum/#!forum/titan-framework) to learn advanced features and answer questions.

Troubleshoot
------------

* If after "vagrant up" you receive a error of Titan's CORE not found, try pause your antvirus, destroy VM (with "vagrant destroy") and make up again (I had problems with Kaspersky).
6 changes: 3 additions & 3 deletions configure/alert.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<alert-mapping>
<alert id="_UPDATE_PROFILE_" message="Faz mais de [DAYS] dias que você não atualiza seus dados pessoais." go="titan.php?target=body&toSection=[SECTION]&toAction=[ACTION]" icon="titan.php?target=loadFile&file=interface/alert/warning.gif" />
<?xml version="1.0" encoding="UTF-8"?>
<alert-mapping>
<alert id="_UPDATE_PROFILE_" message="Faz mais de [DAYS] dias que você não atualiza seus dados pessoais." go="titan.php?target=body&toSection=[SECTION]&toAction=[ACTION]" icon="titan.php?target=loadFile&file=interface/alert/warning.gif" />
</alert-mapping>
46 changes: 27 additions & 19 deletions configure/api.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<api-mapping>
<application
name="mobile"
auth="APP|CLIENT-AS-USER"
token=""
request-timeout="36000"
protocol="Embrapa"
gcm-api-key=""
send-alerts="true"
/>

<application
name="pwa"
auth="APP|USER-BY-MAIL"
token=""
protocol="Jwt"
register-as="manager"
/>
<?xml version="1.0" encoding="UTF-8"?>
<api-mapping>
<application
name="mobile"
auth="APP|CLIENT-AS-USER"
token=""
request-timeout="36000"
protocol="Embrapa"
gcm-api-key=""
send-alerts="true"
/>

<application
name="pwa"
auth="APP|USER-BY-MAIL"
token=""
protocol="Jwt"
register-as="manager">
<endpoint method="GET" uri="\/status" />
<endpoint method="POST" uri="\/pin\/add" />
<endpoint method="POST" uri="\/pin\/del" />
<endpoint method="POST" uri="\/login" />
<endpoint method="GET" uri="\/user" />
<endpoint method="POST" uri="\/user" />
<endpoint method="DELETE" uri="\/user\/[0-9]+" />
<endpoint method="GET" uri="\/disambiguation" />
</application>
</api-mapping>
64 changes: 32 additions & 32 deletions configure/business.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<section-mapping>
<section
label="Home | pt_BR: Página Inicial"
name="home"
component="global.home"
icon="home"
default="true"
/>

<section
label="Base of Files | pt_BR: Banco de Arquivos"
name="archive"
component="global.archive"
icon="files-o"
/>

<section
label="Access Control | pt_BR: Controle de Acesso"
name="access"
component="global.group"
icon="lock"
admin="true"
/>

<section
label="Managers Users | pt_BR: Usuários Gestores"
name="manager"
component="global.userPrivate"
icon="users"
father="access"
/>
<?xml version="1.0" encoding="UTF-8"?>
<section-mapping>
<section
label="Home | pt_BR: Página Inicial"
name="home"
component="global.home"
icon="home"
default="true"
/>

<section
label="Base of Files | pt_BR: Banco de Arquivos"
name="archive"
component="global.archive"
icon="files-o"
/>

<section
label="Access Control | pt_BR: Controle de Acesso"
name="access"
component="global.group"
icon="lock"
admin="true"
/>

<section
label="Managers Users | pt_BR: Usuários Gestores"
name="manager"
component="global.userPrivate"
icon="users"
father="access"
/>
</section-mapping>
26 changes: 13 additions & 13 deletions configure/ldap.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ldap-mapping>
<ldap
id=""
host=""
user=""
password=""
dn=""
ou=""
gid=""
update=""
/>
</ldap-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<ldap-mapping>
<ldap
id=""
host=""
user=""
password=""
dn=""
ou=""
gid=""
update=""
/>
</ldap-mapping>
Loading

0 comments on commit 21358b0

Please sign in to comment.