Skip to content

Commit

Permalink
Merge pull request #32 from GitHarpon/release
Browse files Browse the repository at this point in the history
deploy(release): déploiement de la release sur master
  • Loading branch information
Philiippe authored Feb 12, 2019
2 parents 9858198 + 339f536 commit 450da46
Show file tree
Hide file tree
Showing 78 changed files with 13,111 additions and 202 deletions.
18 changes: 14 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@ before_script:
install:
- npm set progress=false
- npm install
- npm run electron:linux
script:
- ng lint
- npm run test
- npm run e2e
- npm run build
- npm run test:e2e
notifications:
email: false
slack:
rooms:
- secure: YfTFIipqTNzNn4f8ESZkNJk9xZc5jQ/NfidFeuUx4DHfFQ1boq7jfa2Q18QkGt2v2RbWdQnJ8MFUyMD1m4+yEK3hBAcWGxkBw+H09BN7kOBl97gFYc6g4JWIzddyViHzhiQFv8OQ+JORaftkkr0olN/puXApGJTdHW8g551qqNmz/HZg8FJXaRtgUy7itZcEtT+TptA0vR+mM7EEilYO7k7lClBNgdtgmheVRABRQD/iPLiJzQfxFfoAqiKSsTwRC8n5InWXFfa7p8tHeu/K2GScC/DX4ZIluC7ayZlviKiZUDYUb29yfohmiDa3MMtMhgTY8VKNV/eRdL+4fkc1bWm52ns7V80D66O4BRPjgbPhgVF35HsGUjRLTzvqxBDudxXkf36CzQQ113nqg+JnZ/cQEUgVC6FeXLNJEMX5PV8xPH4y2x5CRPc+1TyvTHSwQqII4sJ7+3MkkYuQolEU2UTt1Lh0WstNEIb7KHJeRm5IG96plyfV6Qp7XLyiWLShsP09fxo6FTs0qsChkzWySN0SSQS07HfBwiByTaV7YStGmWHSwJEyyBTUg4Ru9V6oSeS+Hk8JqeIXJ7Ys2F9nZYaPTc6S+PCsgIi53jh33pJfPMG6hWU8G8r04zyShZcgrrrpJuG4fotKMYsSqbKJ7vLfDkkoqoN/mq/pz0qaw5o=
on_success: always
on_failure: always
template:
- "Repo `%{repository_slug}` *%{result}* build (<%{build_url}|#%{build_number}>) for commit *%{commit_message}* (<%{compare_url}|%{commit}>) on branch `%{branch}`."
- ":bust_in_silhouette: : *%{author}*"
- ":timer_clock: : *%{duration}*"
- ":left_speech_bubble: : %{message}"
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
<img width="255" height="255" src="./logo-githarpon.png">
</p>

[![License](https://img.shields.io/github/license/GitHarpon/git-harpon.svg)](LICENSE.md)
![Build](https://travis-ci.org/GitHarpon/git-harpon.svg?branch=master)
![Build on develop](https://img.shields.io/travis/GitHarpon/git-harpon/develop.svg?label=build%20on%20develop&style=flat)

[![Watchers](https://img.shields.io/github/watchers/GitHarpon/git-harpon.svg?style=social)](https://github.com/GitHarpon/git-harpon/watchers)
[![Stargazers](https://img.shields.io/github/stars/GitHarpon/git-harpon.svg?style=social)](https://github.com/GitHarpon/git-harpon/stargazers)
[![Forks](https://img.shields.io/github/forks/GitHarpon/git-harpon.svg?style=social)](https://github.com/GitHarpon/git-harpon/network/members)

# Introduction

Cette application a été réalisée par des étudiants de Master 1 Génie de l'Informatique Logicielle. Il s'agit d'une réponse à un appel d'offre de Guillaume Leroy et Hugo Mochet. L'application doit correspondre à [GitKraken](https://www.gitkraken.com/), une interface graphique de git, mais de façon libre et open-source (licence MIT).
Expand Down Expand Up @@ -63,6 +71,26 @@ Installer les dépendances

```yarn install```

## Structure du projet

|Fichier / Dossier|Description|
|--|--|
|`package.json`| Fichier contenant les dépendances, les scripts et diverses informations sur le projet. |
|`angular.json`| Fichier de configuration pour Angular. |
|`.travis.yml`| Fichier de configuration pour travis. |
|`main.ts`| Fichier d'entré pour Electron. |
|`electron-builder.json`| Fichier contenant toutes les informations pour la création d'une release. |
|`node_modules/`| Dossier contenant les modules natifs et installés. |
|`release/`| Dossier contenant la release après génération. |
|`tests/`| Dossier contenant les fichiers de test. |
|`src/styles.scss`| Feuille de style globale. |
|`src/variables.scss`| Feuille des variables de style. |
|`src/assets/`| Dossier contenant les fichiers de traduction. |
|`src/app/components/`| Dossier contenant les composants. |
|`src/app/screens/`| Dossier contenant les écrans. |
|`src/app/app.module.ts`| Le fichier app.module.ts. Il faut y indiquer l'ensemble des modules/services à ajouter. Contient de base plusieurs services et modules utiles (`TranslateModule`, `TranslateLoader`, `HttpClientModule`, `ElectronService`, etc.) |
|`src/app/app-routing.module.ts`| Fichier pour le routing.|
|`src/app/providers`| Dossier contenant les services. |

## Commandes disponibles

Expand All @@ -78,9 +106,28 @@ Comme expliqué plus haut, nous avons utilisé le kit de démarrage. Le fichier
|`yarn electron:linux`| Sous Linux, build l'application et crée un `.AppImage`. |
|`yarn electron:windows`| Sous Windows, build l'application et crée un `.exe`, exécutable pour les systèmes en 32 et 64 bits. |
|`yarn electron:mac`| Sous macOS, build l'application et crée un `.dmg` contenant le `.app`. |
|`yarn test:e2e`| Lance les tests end-to-end (e2e) |

⚠️ Il faut supprimer le dossier release avant d'en regénérer un autre ⚠️

## Lancer les tests

Comme expliqué ci-dessus, la commande `yarn test:e2e` lance les tests end-to-end. Cependant, il est nécessaire de créer une release avant de lancer cette commande.

### Sur macOS

`yarn electron:mac` puis cliquer sur le .dmg généré et mettre le .app dans le dossier release. On peut alors lancer la commande `yarn test:e2e`.

### Sur Linux

`yarn electron:linux` et s'assurer d'avoir lancer une fois le .AppImage pour que la fenêtre de dialogue ne s'affiche plus par la suite. On peut alors lancer la commande `yarn test:e2e`.


### Sur Windows

`yarn electron:windows` puis lancer la commande `yarn test:e2e`.


## Ajouter un package

```yarn add [package]```
Expand All @@ -96,7 +143,7 @@ Pour cela, il suffit de les ajouter au service ElectronService. Plusieurs module


# Contributeurs
* [Cyrielle Angoula Meka]()
* [Cyrielle Angoula Meka](https://github.com/cissouxxx)
* [Julien Besnier](https://github.com/BesnierJulien)
* [Martin Blondel](https://github.com/Philiippe)
* [Clément Drouin](https://github.com/Nemtecl)
Expand Down
1 change: 1 addition & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/@fortawesome/fontawesome-free/css/all.css",
"src/styles.scss"
],
"scripts": [
Expand Down
1 change: 1 addition & 0 deletions electron-builder.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"productName": "git-harpon",
"artifactName": "${productName}-${version}.${ext}",
"directories": {
"output": "release/"
},
Expand Down
23 changes: 20 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { app, BrowserWindow, screen } from 'electron';
import * as path from 'path';
import * as url from 'url';
import * as os from 'os';
import * as fs from 'fs';

let win, serve;
const args = process.argv.slice(1);
Expand All @@ -16,7 +18,8 @@ function createWindow() {
x: 0,
y: 0,
width: size.width,
height: size.height
height: size.height,
icon: path.join(__dirname, 'src/favicon.256x256.png')
});

if (serve) {
Expand All @@ -32,7 +35,7 @@ function createWindow() {
}));
}

win.webContents.openDevTools();
// win.webContents.openDevTools();

// Emitted when the window is closed.
win.on('closed', () => {
Expand All @@ -41,7 +44,21 @@ function createWindow() {
// when you should delete the corresponding element.
win = null;
});


var auguryPath = '';
if (process.platform === 'darwin') {
auguryPath = '/Library/Application\ Support/Google/Chrome/Default/Extensions/elgalmkoelokbchhkhacckoklkejnhcd/1.22.0_0/';
} else if (process.platform === 'linux') {
auguryPath = '.config/google-chrome/Default/Extensions/elgalmkoelokbchhkhacckoklkejnhcd/1.22.0_0';
} else if (process.platform === 'win32') {
auguryPath = 'AppData/Local/Google/Chrome/User Data/Default/Extensions/elgalmkoelokbchhkhacckoklkejnhcd/1.22.0_0';
}
if (fs.existsSync(path.join(os.homedir(), auguryPath))) {
// Pour avoir le devtools Augury, à changer selon l'os, le pc etc...
BrowserWindow.addDevToolsExtension(
path.join(os.homedir(), auguryPath)
);
}
}

try {
Expand Down
22 changes: 19 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,31 @@
"electron:windows": "npm run build:prod && npx electron-builder build --windows",
"electron:mac": "npm run build:prod && npx electron-builder build --mac",
"test": "npm run postinstall:web && ng test",
"e2e": "npm run postinstall:web && ng e2e"
"e2e": "npm run postinstall:web && ng e2e",
"test:e2e": "mocha --timeout 15000 tests/test.js"
},
"dependencies": {
"@angular/animations": "^7.1.4",
"@angular/animations": "^7.2.4",
"@angular/cdk": "^7.3.1",
"@angular/material": "^7.3.1",
"@angular/platform-server": "^7.1.4",
"@ng-bootstrap/ng-bootstrap": "^4.0.2",
"bootstrap": "4.1.3",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"jquery": "^3.3.1",
"mocha": "^5.2.0",
"mocha-sinon": "^2.1.0",
"monaco-editor": "^0.14.3",
"ngx-clipboard": "^11.1.9",
"ngx-contextmenu": "^5.1.1",
"ngx-scrollbar": "^4.1.1",
"ngx-toastr": "^9.1.1",
"popper.js": "^1.14.7",
"rxjs-compat": "^6.3.3",
"rxjs-tslint": "^0.1.6"
"rxjs-tslint": "^0.1.6",
"sinon": "^7.2.3",
"spectron": "^5.0.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.11.4",
Expand All @@ -53,6 +68,7 @@
"@angular/platform-browser": "^7.1.4",
"@angular/platform-browser-dynamic": "^7.1.4",
"@angular/router": "^7.1.4",
"@fortawesome/fontawesome-free": "^5.7.1",
"@ngx-translate/core": "10.0.1",
"@ngx-translate/http-loader": "3.0.1",
"@types/jasmine": "^3.3.5",
Expand Down
17 changes: 14 additions & 3 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
import { HomeComponent } from './components/home/home.component';

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ToolboxComponent } from './components/toolbox/toolbox.component';
import { HomeComponent } from './components/home/home.component';

const routes: Routes = [
const ROUTES: Routes = [
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
},
{
path: 'home',
component: HomeComponent
},
{
path: 'toolbox',
component: ToolboxComponent
}
];

@NgModule({
imports: [RouterModule.forRoot(routes, {useHash: true})],
imports: [RouterModule.forRoot(ROUTES, {useHash: true})],
exports: [RouterModule]
})
export class AppRoutingModule { }
4 changes: 3 additions & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<router-outlet></router-outlet>
<div style="height:100%; width: 100%;">
<router-outlet></router-outlet>
</div>
3 changes: 2 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export class AppComponent {
constructor(public electronService: ElectronService,
private translate: TranslateService) {

translate.setDefaultLang('en');
this.translate.addLangs(['fr', 'en']);
this.translate.setDefaultLang(this.translate.getLangs()[0]);
console.log('AppConfig', AppConfig);

if (electronService.isElectron()) {
Expand Down
50 changes: 45 additions & 5 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ import 'reflect-metadata';
import '../polyfills';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

import { HttpClientModule, HttpClient } from '@angular/common/http';

import { AppRoutingModule } from './app-routing.module';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NgScrollbarModule } from 'ngx-scrollbar';
import {MatTabsModule, MatIconModule } from '@angular/material';
import { ContextMenuModule } from 'ngx-contextmenu';
import { ClipboardModule } from 'ngx-clipboard';


// NG Translate
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
Expand All @@ -18,13 +24,26 @@ import { ElectronService } from './providers/electron.service';
import { WebviewDirective } from './directives/webview.directive';

import { AppComponent } from './app.component';
import { HomeComponent } from './components/home/home.component';
import { MonacoEditorWrapperComponent } from './components/monaco-wrapper/monaco-editor-wrapper.component';
import { CommonModule } from '@angular/common';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { ToastrModule } from 'ngx-toastr';
import { EditorPreferencesService } from './providers/editor-preferences.service';
import { FooterComponent } from './components/footer/footer.component';
import { HomeComponent } from './components/home/home.component';
import { ToolboxComponent } from './components/toolbox/toolbox.component';
import { ContainerComponent } from './components/container/container.component';
import { CheckboxComponent } from './components/checkbox/checkbox.component';
import { ButtonComponent } from './components/button/button.component';
import { DropdownComponent } from './components/dropdown/dropdown.component';
import { IconButtonComponent } from './components/icon-button/icon-button.component';
import { InputComponent } from './components/input/input.component';
import { LoaderComponent } from './components/loader/loader.component';
import { ModalComponent } from './components/modal/modal.component';
import { InputNumberComponent } from './components/input-number/input-number.component';
import { CopyButtonComponent } from './components/copy-button/copy-button.component';


// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {
Expand All @@ -34,11 +53,29 @@ export function HttpLoaderFactory(http: HttpClient) {
@NgModule({
declarations: [
AppComponent,
HomeComponent,
WebviewDirective,
MonacoEditorWrapperComponent
MonacoEditorWrapperComponent,
FooterComponent,
HomeComponent,
ToolboxComponent,
ContainerComponent,
CheckboxComponent,
ButtonComponent,
DropdownComponent,
IconButtonComponent,
InputComponent,
LoaderComponent,
ModalComponent,
InputNumberComponent,
CopyButtonComponent
],
imports: [
ReactiveFormsModule,
MatIconModule,
MatTabsModule,
NgScrollbarModule,
NgbModule,
ClipboardModule,
BrowserModule,
CommonModule,
FormsModule,
Expand All @@ -52,7 +89,10 @@ export function HttpLoaderFactory(http: HttpClient) {
}
}),
BrowserAnimationsModule,
ToastrModule.forRoot()
ToastrModule.forRoot(),
ContextMenuModule.forRoot({
useBootstrap4: true
})
],
providers: [ElectronService, EditorPreferencesService],
bootstrap: [AppComponent]
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/button/button.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<input class="gh-button" [type]="submit ? 'submit' : 'button'" [disabled]="disabled" [value]="value ? getValueTranslation() : ''" (click)="execClick($event)"
[ngClass]="[type, (disabled ? 'disabled' : ''), (large ? 'large' : '')]" />
Loading

0 comments on commit 450da46

Please sign in to comment.