forked from cloudron-apps/gitea-app
Merge branch 'update_to_1.1.3' into 'master'
Update to 1.1.3 See merge request !3
This commit is contained in:
commit
b8b3abfbfc
5 changed files with 64 additions and 28 deletions
|
@ -9,3 +9,7 @@
|
|||
|
||||
[0.1.3]
|
||||
* Updated to version 1.1.2
|
||||
|
||||
[1.0.0]
|
||||
* Update to version 1.1.3
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"author": "Gitea developers",
|
||||
"description": "file://DESCRIPTION.md",
|
||||
"tagline": "A painless self-hosted Git Service",
|
||||
"version": "0.1.3",
|
||||
"version": "1.0.0",
|
||||
"healthCheckPath": "/healthcheck",
|
||||
"httpPort": 3000,
|
||||
"addons": {
|
||||
|
|
|
@ -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](https://blog.gitea.io/2016/12/welcome-to-gitea/) blog post.
|
||||
|
||||
This app packages Gitea <upstream>1.1.2</upstream>
|
||||
This app packages Gitea <upstream>1.1.3</upstream>
|
||||
|
||||
### Purpose
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
FROM cloudron/base:0.10.0
|
||||
|
||||
ENV VERSION 1.1.2
|
||||
ENV VERSION 1.1.3
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y openssh-server && \
|
||||
|
|
82
test/test.js
82
test/test.js
|
@ -63,6 +63,14 @@ describe('Application life cycle test', function () {
|
|||
}, TIMEOUT).then(function () { done(); });
|
||||
}
|
||||
|
||||
function getAppInfo() {
|
||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
||||
|
||||
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
|
||||
|
||||
expect(app).to.be.an('object');
|
||||
}
|
||||
|
||||
function setAvatar(done) {
|
||||
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'));
|
||||
|
@ -160,7 +168,7 @@ describe('Application life cycle test', function () {
|
|||
});
|
||||
}
|
||||
|
||||
function checkGitClone(done) {
|
||||
function cloneRepo(done) {
|
||||
rimraf.sync(repodir);
|
||||
var env = Object.create(process.env);
|
||||
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
|
||||
|
@ -168,6 +176,19 @@ describe('Application life cycle test', function () {
|
|||
done();
|
||||
}
|
||||
|
||||
function pushFile(done) {
|
||||
var env = Object.create(process.env);
|
||||
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
|
||||
execSync('touch newfile && git add newfile && git commit -a -mx && git push ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + ' master',
|
||||
{ env: env, cwd: repodir });
|
||||
rimraf.sync('/tmp/testrepo');
|
||||
done();
|
||||
}
|
||||
|
||||
function fileExists() {
|
||||
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
|
||||
}
|
||||
|
||||
xit('build app', function () {
|
||||
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
});
|
||||
|
@ -199,14 +220,7 @@ describe('Application life cycle test', function () {
|
|||
execSync('cloudron install --new --wait --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
});
|
||||
|
||||
it('can get app information', function () {
|
||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
||||
|
||||
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
|
||||
|
||||
expect(app).to.be.an('object');
|
||||
});
|
||||
|
||||
it('can get app information', getAppInfo);
|
||||
it('can get the main page', function (done) {
|
||||
superagent.get('https://' + app.fqdn).end(function (error, result) {
|
||||
expect(error).to.be(null);
|
||||
|
@ -226,27 +240,19 @@ describe('Application life cycle test', function () {
|
|||
|
||||
it('displays correct clone url', checkCloneUrl);
|
||||
|
||||
it('can clone the url', checkGitClone);
|
||||
|
||||
it('can add and push a file', function (done) {
|
||||
var env = Object.create(process.env);
|
||||
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
|
||||
execSync('touch newfile && git add newfile && git commit -a -mx && git push ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + ' master',
|
||||
{ env: env, cwd: repodir });
|
||||
rimraf.sync('/tmp/testrepo');
|
||||
done();
|
||||
});
|
||||
it('can clone the url', cloneRepo);
|
||||
|
||||
it('can add and push a file', pushFile);
|
||||
it('can edit file', editFile);
|
||||
|
||||
it('can restart app', function (done) {
|
||||
execSync('cloudron restart');
|
||||
execSync('cloudron restart --wait');
|
||||
done();
|
||||
});
|
||||
|
||||
it('can clone the url', checkCloneUrl);
|
||||
it('can clone the url', checkGitClone);
|
||||
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
|
||||
it('can clone the url', cloneRepo);
|
||||
it('file exists in repo', fileExists);
|
||||
|
||||
it('backup app', function () {
|
||||
execSync('cloudron backup create --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
|
@ -257,12 +263,12 @@ describe('Application life cycle test', function () {
|
|||
});
|
||||
|
||||
it('can get avatar', checkAvatar);
|
||||
it('can clone the url', checkGitClone);
|
||||
it('can clone the url', cloneRepo);
|
||||
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
|
||||
|
||||
it('move to different location', function () {
|
||||
browser.manage().deleteAllCookies();
|
||||
execSync('cloudron configure --location ' + LOCATION + '2', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
execSync('cloudron configure --wait --location ' + LOCATION + '2', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
||||
app = inspect.apps.filter(function (a) { return a.location === LOCATION + '2'; })[0];
|
||||
expect(app).to.be.an('object');
|
||||
|
@ -271,7 +277,7 @@ describe('Application life cycle test', function () {
|
|||
it('can login', login);
|
||||
it('can get avatar', checkAvatar);
|
||||
it('displays correct clone url', checkCloneUrl);
|
||||
it('can clone the url', checkGitClone);
|
||||
it('can clone the url', cloneRepo);
|
||||
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
|
||||
|
||||
it('uninstall app', function () {
|
||||
|
@ -292,4 +298,30 @@ describe('Application life cycle test', function () {
|
|||
done();
|
||||
});
|
||||
});
|
||||
|
||||
// test update
|
||||
it('can install app', function () {
|
||||
execSync('cloudron install --new --wait --appstore-id ' + app.manifest.id + ' --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
});
|
||||
|
||||
it('can get app information', getAppInfo);
|
||||
it('can login', login);
|
||||
it('can set avatar', setAvatar);
|
||||
it('can get avatar', checkAvatar);
|
||||
it('can add public key', addPublicKey);
|
||||
it('can create repo', createRepo);
|
||||
it('can clone the url', cloneRepo);
|
||||
it('can add and push a file', pushFile);
|
||||
|
||||
it('can update', function () {
|
||||
execSync('cloudron install --wait --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
});
|
||||
|
||||
it('can get avatar', checkAvatar);
|
||||
it('can clone the url', cloneRepo);
|
||||
it('file exists in cloned repo', fileExists);
|
||||
|
||||
it('uninstall app', function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue