1
0
mirror of https://git.cloudron.io/cloudron/gitea-app synced 2025-09-27 07:27:27 +00:00

Compare commits

..

10 Commits

Author SHA1 Message Date
Dennis Schwerdel
5ecde5c49b Version 0.1.2 2017-06-03 00:17:19 +02:00
dswd
47a9de45c9 Merge branch 'fix_tests' into 'master'
Fix tests

See merge request !2
2017-06-02 22:15:50 +00:00
dswd
cc112ff9bb Merge branch 'description' into 'master'
Description

See merge request !1
2017-06-02 22:15:20 +00:00
Girish Ramakrishnan
8b7ec669bc restart now requires wait 2017-06-02 14:58:13 -07:00
Girish Ramakrishnan
6ab83644d7 TIMEOUT must be a number 2017-06-02 14:58:07 -07:00
Girish Ramakrishnan
5827bf87a7 Use promises correctly in tests 2017-06-02 14:58:02 -07:00
Girish Ramakrishnan
b4156a8192 Replace media links with cloudron CDN links 2017-06-02 14:08:01 -07:00
Girish Ramakrishnan
f89a2ab8d4 Update description 2017-06-02 13:58:45 -07:00
Dennis Schwerdel
5522fc9398 Version 0.1.1 2017-06-02 17:55:05 +02:00
Dennis Schwerdel
240716671d Removed last reference to Gogs 2017-06-02 17:52:03 +02:00
4 changed files with 119 additions and 124 deletions

View File

@@ -1,3 +1,8 @@
[0.1.0] [0.1.0]
* Initial package (forked from Gogs app) * Initial package (forked from Gogs app)
[0.1.1]
* Removed reference to Gogs
[0.1.2]
* Updated description

View File

@@ -4,7 +4,7 @@
"author": "Gitea developers", "author": "Gitea developers",
"description": "file://DESCRIPTION.md", "description": "file://DESCRIPTION.md",
"tagline": "A painless self-hosted Git Service", "tagline": "A painless self-hosted Git Service",
"version": "0.1.0", "version": "0.1.2",
"healthCheckPath": "/healthcheck", "healthCheckPath": "/healthcheck",
"httpPort": 3000, "httpPort": 3000,
"addons": { "addons": {
@@ -25,15 +25,11 @@
"contactEmail": "apps@cloudron.io", "contactEmail": "apps@cloudron.io",
"icon": "file://logo.png", "icon": "file://logo.png",
"mediaLinks": [ "mediaLinks": [
"https://i.imgur.com/3iEQsux.jpg", "https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/1.png",
"https://i.imgur.com/glqFnj8.jpg", "https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/2.png",
"https://i.imgur.com/ad1FEpi.jpg", "https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/3.png",
"https://i.imgur.com/q81EcGa.jpg", "https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/4.png",
"https://i.imgur.com/L2CQeN0.jpg", "https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/5.png"
"https://i.imgur.com/cNuvMum.jpg",
"https://i.imgur.com/xCYRqaF.jpg",
"https://i.imgur.com/ILpRBCe.jpg",
"https://i.imgur.com/0BHnrcL.jpg"
], ],
"tags": [ "version control", "git", "code hosting", "development" ], "tags": [ "version control", "git", "code hosting", "development" ],
"changelog": "file://CHANGELOG", "changelog": "file://CHANGELOG",

View File

@@ -1,6 +1,6 @@
Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on Gogs but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read this blog post. Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on Gogs but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read [this](https://blog.gitea.io/2016/12/welcome-to-gitea/) blog post.
This app packages Gogs <upstream>1.1.1</upstream> This app packages Gitea <upstream>1.1.1</upstream>
### Purpose ### Purpose
@@ -20,9 +20,7 @@ The goal of this project is to make the easiest, fastest, and most painless way
- Gravatar and custom source - Gravatar and custom source
- Mail service - Mail service
- Administration panel - Administration panel
- Supports MySQL, PostgreSQL, SQLite3 and [TiDB](https://github.com/pingcap/tidb) (experimental)
- Multi-language support ([15 languages](https://crowdin.com/project/gogs))
### Bug reports ### Bug reports
Open bugs on [Github](https://git.cloudron.io/dswd/gitea-app/issues) Open bugs on [Github](https://git.cloudron.io/cloudron/gitea-app/issues)

View File

@@ -33,7 +33,7 @@ describe('Application life cycle test', function () {
var app, reponame = 'testrepo'; var app, reponame = 'testrepo';
var username = process.env.USERNAME; var username = process.env.USERNAME;
var password = process.env.PASSWORD; var password = process.env.PASSWORD;
var TIMEOUT = process.env.TIMEOUT || 5000; var TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 5000;
var email, token; var email, token;
before(function (done) { before(function (done) {
@@ -64,11 +64,11 @@ describe('Application life cycle test', function () {
} }
function setAvatar(done) { function setAvatar(done) {
browser.get('https://' + app.fqdn + '/user/settings/avatar'); browser.get('https://' + app.fqdn + '/user/settings/avatar').then(function () {
return browser.findElement(by.xpath('//input[@type="file" and @name="avatar"]')).sendKeys(path.resolve(__dirname, '../logo.png'));
browser.findElement(by.xpath('//input[@type="file" and @name="avatar"]')).sendKeys(path.resolve(__dirname, '../logo.png')).then(function () { }).then(function () {
browser.findElement(by.xpath('//button[contains(text(), "Update Avatar Setting")]')).click(); return browser.findElement(by.xpath('//button[contains(text(), "Update Avatar Setting")]')).click();
}).then(function () {
browser.wait(until.elementLocated(by.xpath('//p[contains(text(),"updated successfully")]')), TIMEOUT).then(function () { done(); }); browser.wait(until.elementLocated(by.xpath('//p[contains(text(),"updated successfully")]')), TIMEOUT).then(function () { done(); });
}); });
} }
@@ -82,18 +82,92 @@ describe('Application life cycle test', function () {
} }
function editFile(done) { function editFile(done) {
browser.get('https://' + app.fqdn + '/' + username + '/' + reponame + '/_edit/master/newfile'); browser.get('https://' + app.fqdn + '/' + username + '/' + reponame + '/_edit/master/newfile').then(function () {
var cm = browser.findElement(by.xpath('//div[contains(@class,"CodeMirror")]'));
var cm = browser.findElement(by.xpath('//div[contains(@class,"CodeMirror")]')); var text = 'yo';
var text = 'yo'; return browser.executeScript('arguments[0].CodeMirror.setValue("' + text + '");', cm);
browser.executeScript('arguments[0].CodeMirror.setValue("' + text + '");', cm).then(function () { }).then(function () {
browser.findElement(by.xpath('//input[@name="commit_summary"]')).sendKeys('Dummy edit'); return browser.findElement(by.xpath('//input[@name="commit_summary"]')).sendKeys('Dummy edit');
browser.findElement(by.xpath('//button[contains(text(), "Commit Changes")]')).click(); }).then(function () {
return browser.findElement(by.xpath('//button[contains(text(), "Commit Changes")]')).click();
}).then(function () {
waitForUrl('https://' + app.fqdn + '/' + username + '/' + reponame + '/src/master/newfile', done); waitForUrl('https://' + app.fqdn + '/' + username + '/' + reponame + '/src/master/newfile', done);
}); });
} }
function login(done) {
browser.get('https://' + app.fqdn + '/user/login').then(function () {
return browser.findElement(by.id('user_name')).sendKeys(username);
}).then(function () {
return browser.findElement(by.id('password')).sendKeys(password);
}).then(function () {
return browser.findElement(by.tagName('form')).submit();
}).then(function () {
return browser.wait(until.elementLocated(by.linkText('Dashboard')), TIMEOUT);
}).then(function () {
done();
});
}
function addPublicKey(done) {
var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
browser.get('https://' + app.fqdn + '/user/settings/ssh').then(function () {
return browser.findElement(by.xpath('//div[text()="Add Key"]')).click();
}).then(function () {
return browser.findElement(by.id('ssh-key-title')).sendKeys('testkey');
}).then(function () {
return browser.findElement(by.id('ssh-key-content')).sendKeys(publicKey.trim()); // #3480
}).then(function () {
return browser.findElement(by.xpath('//button[contains(text(), "Add Key")]')).click();
}).then(function () {
return browser.wait(until.elementLocated(by.xpath('//p[contains(text(), "added successfully!")]')), TIMEOUT);
}).then(function () {
done();
});
}
function createRepo(done) {
browser.get('https://' + app.fqdn).then(function () {
return browser.findElement(by.linkText('New Repository')).click();
}).then(function () {
return browser.wait(until.elementLocated(by.xpath('//*[contains(text(), "New Repository")]')), TIMEOUT);
}).then(function () {
return browser.findElement(by.id('repo_name')).sendKeys(reponame);
}).then(function () {
return browser.findElement(by.id('auto-init')).click();
}).then(function () {
return browser.findElement(by.xpath('//button[contains(text(), "Create Repository")]')).click();
}).then(function () {
browser.wait(function () {
return browser.getCurrentUrl().then(function (url) {
return url === 'https://' + app.fqdn + '/' + username + '/' + reponame;
});
}, TIMEOUT);
}).then(function () {
done();
});
}
function checkCloneUrl(done) {
browser.get('https://' + app.fqdn + '/' + username + '/' + reponame).then(function () {
return browser.findElement(by.id('repo-clone-ssh')).click();
}).then(function () {
return browser.findElement(by.id('repo-clone-url')).getAttribute('value');
}).then(function (cloneUrl) {
expect(cloneUrl).to.be('ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git');
done();
});
}
function checkGitClone(done) {
rimraf.sync(repodir);
var env = Object.create(process.env);
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
execSync('git clone ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git ' + repodir, { env: env });
done();
}
xit('build app', function () { xit('build app', function () {
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
}); });
@@ -121,7 +195,6 @@ describe('Application life cycle test', function () {
}); });
}); });
it('install app', function () { it('install app', function () {
execSync('cloudron install --new --wait --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron install --new --wait --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
}); });
@@ -143,57 +216,17 @@ describe('Application life cycle test', function () {
}); });
}); });
it('can login', function (done) { it('can login', login);
browser.get('https://' + app.fqdn + '/user/login');
browser.findElement(by.id('user_name')).sendKeys(username);
browser.findElement(by.id('password')).sendKeys(password);
browser.findElement(by.tagName('form')).submit();
browser.wait(until.elementLocated(by.linkText('Dashboard')), TIMEOUT).then(function () { done(); });
});
it('can set avatar', setAvatar); it('can set avatar', setAvatar);
it('can get avatar', checkAvatar); it('can get avatar', checkAvatar);
it('can add public key', function (done) { it('can add public key', addPublicKey);
browser.get('https://' + app.fqdn + '/user/settings/ssh');
var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
browser.findElement(by.xpath('//div[text()="Add Key"]')).click(); it('can create repo', createRepo);
browser.findElement(by.id('ssh-key-title')).sendKeys('testkey');
browser.findElement(by.id('ssh-key-content')).sendKeys(publicKey.trim()); // #3480
browser.findElement(by.xpath('//button[contains(text(), "Add Key")]')).click();
browser.wait(until.elementLocated(by.xpath('//p[contains(text(), "added successfully!")]')), TIMEOUT).then(function () { done(); });
});
it('can create repo', function (done) { it('displays correct clone url', checkCloneUrl);
browser.get('https://' + app.fqdn);
browser.findElement(by.linkText('New Repository')).click();
browser.wait(until.elementLocated(by.xpath('//*[contains(text(), "New Repository")]')), TIMEOUT);
browser.findElement(by.id('repo_name')).sendKeys(reponame);
browser.findElement(by.id('auto-init')).click();
browser.findElement(by.xpath('//button[contains(text(), "Create Repository")]')).click();
browser.wait(function () {
return browser.getCurrentUrl().then(function (url) {
return url === 'https://' + app.fqdn + '/' + username + '/' + reponame;
});
}, TIMEOUT).then(function () { done(); });
});
it('displays correct clone url', function (done) { it('can clone the url', checkGitClone);
browser.get('https://' + app.fqdn + '/' + username + '/' + reponame);
browser.findElement(by.id('repo-clone-ssh')).click();
browser.findElement(by.id('repo-clone-url')).getAttribute('value').then(function (cloneUrl) {
expect(cloneUrl).to.be('ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git');
done();
});
});
it('can clone the url', function (done) {
var env = Object.create(process.env);
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
execSync('git clone ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git ' + repodir, { env: env });
done();
});
it('can add and push a file', function (done) { it('can add and push a file', function (done) {
var env = Object.create(process.env); var env = Object.create(process.env);
@@ -207,18 +240,13 @@ describe('Application life cycle test', function () {
it('can edit file', editFile); it('can edit file', editFile);
it('can restart app', function (done) { it('can restart app', function (done) {
execSync('cloudron restart'); execSync('cloudron restart --wait');
done(); done();
}); });
it('can clone the url', function (done) { it('can clone the url', checkCloneUrl);
var env = Object.create(process.env); it('can clone the url', checkGitClone);
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh'; it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
execSync('git clone ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git ' + repodir, { env: env });
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
rimraf.sync(repodir);
done();
});
it('backup app', function () { it('backup app', function () {
execSync('cloudron backup create --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron backup create --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
@@ -229,15 +257,8 @@ describe('Application life cycle test', function () {
}); });
it('can get avatar', checkAvatar); it('can get avatar', checkAvatar);
it('can clone the url', checkGitClone);
it('can clone the url', function (done) { it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
var env = Object.create(process.env);
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
execSync('git clone ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git ' + repodir, { env: env });
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
rimraf.sync(repodir);
done();
});
it('move to different location', function () { it('move to different location', function () {
browser.manage().deleteAllCookies(); browser.manage().deleteAllCookies();
@@ -247,33 +268,11 @@ describe('Application life cycle test', function () {
expect(app).to.be.an('object'); expect(app).to.be.an('object');
}); });
it('can login', function (done) { it('can login', login);
browser.get('https://' + app.fqdn + '/user/login');
browser.findElement(by.id('user_name')).sendKeys(username);
browser.findElement(by.id('password')).sendKeys(password);
browser.findElement(by.tagName('form')).submit();
browser.wait(until.elementLocated(by.linkText('Dashboard')), TIMEOUT).then(function () { done(); });
});
it('can get avatar', checkAvatar); it('can get avatar', checkAvatar);
it('displays correct clone url', checkCloneUrl);
it('displays correct clone url', function (done) { it('can clone the url', checkGitClone);
browser.get('https://' + app.fqdn + '/' + username + '/' + reponame); it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
browser.findElement(by.id('repo-clone-ssh')).click();
browser.findElement(by.id('repo-clone-url')).getAttribute('value').then(function (cloneUrl) {
expect(cloneUrl).to.be('ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git');
done();
});
});
it('can clone the url', function (done) {
var env = Object.create(process.env);
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
execSync('git clone ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git ' + repodir, { env: env });
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
rimraf.sync(repodir);
done();
});
it('uninstall app', function () { it('uninstall app', function () {
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
@@ -287,11 +286,8 @@ describe('Application life cycle test', function () {
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0]; app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
expect(app).to.be.an('object'); expect(app).to.be.an('object');
browser.get('https://' + app.fqdn + '/user/login'); login(function (error) {
browser.findElement(by.id('user_name')).sendKeys(email); if (error) return done(error);
browser.findElement(by.id('password')).sendKeys(password);
browser.findElement(by.tagName('form')).submit();
browser.wait(until.elementLocated(by.linkText('Dashboard')), TIMEOUT).then(function () {
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
done(); done();
}); });