1
0
mirror of https://git.cloudron.io/cloudron/gitea-app synced 2025-09-29 08:23:24 +00:00

Compare commits

..

12 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
Dennis Schwerdel
3a98f57031 Fixed tests 2017-06-02 11:20:27 +02:00
Dennis Schwerdel
a37ce3ea37 First working version, tests follow 2017-06-02 10:32:24 +02:00
12 changed files with 159 additions and 248 deletions

100
CHANGELOG
View File

@@ -1,96 +1,8 @@
[0.6.10]
* Works with readonly rootfs
[0.1.0]
* Initial package (forked from Gogs app)
[0.6.11]
* Fix bug where app wouldn't start up
[0.7.0]
* Update to latest base image
[0.7.1]
* Remove some backward compat code
[0.8.0]
* Use Gogs 0.8.25
* Support GitHub style Markdown checklist
* Add more APIs: user followers
* Support side-by-side diff view
* Support highlight inline diff
* Complete [Changelog](https://github.com/gogits/gogs/releases/tag/v0.8.25)
[0.9.0]
* Use 'git' instead of 'cloudron' user
[0.10.0]
* Use Gogs 0.8.43
* Issue references have bad links behind a reverse proxy sub-path #2229
[0.11.0]
* Use Gogs 0.9.0
* [Changelog](https://github.com/gogits/gogs/releases/tag/v0.9.0)
[0.12.0]
* Use Gogs 0.9.13
[0.12.1]
* Fix username login
[0.12.2]
* Allow disabling SSH
[0.12.3]
* Fix login via email
[0.12.4]
* Fix ldap update query
[0.12.5]
* Preserve ssh host keys across updates
[0.12.6]
* Use latest SMTP configuration
[0.12.7]
* Update base image to 0.8.1
[0.13.0]
* Update Gogs to 0.9.48
* [Changelog](https://github.com/gogits/gogs/releases/tag/v0.9.48)
[0.13.1]
* Update Gogs to 0.9.71
* [Changelog](https://github.com/gogits/gogs/releases/tag/v0.9.71)
[0.13.2]
* Update base image
[0.13.3]
* Implement public mode
[0.13.4]
* Add post install message
[0.13.5]
* Fix post install message
[0.14.0]
* Update base image
* Update Gogs to 0.9.128
[0.14.1]
* Update description
[0.15.0]
* Update to 0.10.18
[0.16.0]
* Update Gogs to 0.11
* Fix issue where custom avatars could not be uploaded
* Fix issue where web based editing would not work
[0.16.1]
* Update Gogs to 0.11.4
[0.16.2]
* Update description
[0.1.1]
* Removed reference to Gogs
[0.1.2]
* Updated description

View File

@@ -1,10 +1,10 @@
{
"id": "io.gogs.cloudronapp",
"title": "Gogs",
"author": "Gogs developers",
"id": "io.gitea.cloudronapp",
"title": "Gitea",
"author": "Gitea developers",
"description": "file://DESCRIPTION.md",
"tagline": "A painless self-hosted Git Service",
"version": "0.16.2",
"version": "0.1.2",
"healthCheckPath": "/healthcheck",
"httpPort": 3000,
"addons": {
@@ -21,14 +21,15 @@
}
},
"manifestVersion": 1,
"website": "https://gogs.io",
"website": "https://gitea.io",
"contactEmail": "apps@cloudron.io",
"icon": "file://logo.png",
"mediaLinks": [
"https://gogs.io/img/screenshots/1.png",
"https://gogs.io/img/screenshots/2.png",
"https://gogs.io/img/screenshots/4.png",
"https://gogs.io/img/screenshots/5.png"
"https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/1.png",
"https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/2.png",
"https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/3.png",
"https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/4.png",
"https://s3.amazonaws.com/cloudron-app-screenshots/io.gitea.cloudronapp/f89a2ab8d49094c80589f69a2d60bef63b2dbb62/5.png"
],
"tags": [ "version control", "git", "code hosting", "development" ],
"changelog": "file://CHANGELOG",

View File

@@ -1,6 +1,6 @@
Gogs (Go Git Service) is a painless self-hosted Git service.
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>0.11.4</upstream>
This app packages Gitea <upstream>1.1.1</upstream>
### Purpose
@@ -20,9 +20,7 @@ The goal of this project is to make the easiest, fastest, and most painless way
- Gravatar and custom source
- Mail service
- 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
Open bugs on [Github](https://git.cloudron.io/cloudron/gogs-app/issues)
Open bugs on [Github](https://git.cloudron.io/cloudron/gitea-app/issues)

View File

@@ -1,5 +1,7 @@
FROM cloudron/base:0.10.0
ENV VERSION 1.1.1
RUN apt-get update && \
apt-get install -y openssh-server && \
rm -rf /etc/ssh_host_* && \
@@ -7,22 +9,22 @@ RUN apt-get update && \
ADD supervisor/ /etc/supervisor/conf.d/
RUN adduser --disabled-login --gecos 'Gogs' git
RUN adduser --disabled-login --gecos 'Gitea' git
# by default, git account is created as inactive which prevents login via openssh
# https://github.com/gitlabhq/gitlabhq/issues/5304
RUN passwd -d git
RUN mkdir -p /home/git/gogs
RUN mkdir -p /home/git/gitea
## TODO: use redis as well
RUN cd /home/git/gogs && \
curl -L https://github.com/gogits/gogs/releases/download/v0.11.4/linux_amd64.tar.gz | tar zxvf - --strip-components 1
RUN curl -L https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64 -o /home/git/gitea/gitea \
&& chmod +x /home/git/gitea/gitea
# setup config paths
ADD app.ini.template /home/git/app.ini.template
# setup log paths
RUN mkdir -p /run/gogs && chown -R git:git /run/gogs
RUN sed -e 's,^logfile=.*$,logfile=/run/gogs/supervisord.log,' -i /etc/supervisor/supervisord.conf
RUN mkdir -p /run/gitea && chown -R git:git /run/gitea
RUN sed -e 's,^logfile=.*$,logfile=/run/gitea/supervisord.log,' -i /etc/supervisor/supervisord.conf
RUN ln -s /app/data/ssh /home/git/.ssh
RUN ln -s /app/data/gitconfig /home/git/.gitconfig

View File

@@ -1,5 +1,5 @@
This app integrates with the Cloudron SSO. Admins on Cloudron automatically
become admins on Gogs.
become admins on Gitea.
If you want to disable Cloudron SSO, do the following:
@@ -7,6 +7,6 @@ If you want to disable Cloudron SSO, do the following:
* Admin Panel -> Users -> Change Authentication Source to 'Local' and also give a password
You can create a `/app/data/app.ini` with any custom configuration. See the
[configuration cheat sheet](https://gogs.io/docs/advanced/configuration_cheat_sheet)
[configuration cheat sheet](https://docs.gitea.io/en-us/config-cheat-sheet)
for more information.

View File

@@ -1,15 +1,15 @@
# Gogs Cloudron App
# Gitea Cloudron App
This repository contains the Cloudron app package source for [Gogs](http://gogs.io/).
This repository contains the Cloudron app package source for [Gitea](http://gitea.io/).
## Installation
[![Install](https://cloudron.io/img/button.svg)](https://cloudron.io/button.html?app=io.gogs.cloudronapp)
[![Install](https://cloudron.io/img/button.svg)](https://cloudron.io/button.html?app=io.gitea.cloudronapp)
or using the [Cloudron command line tooling](https://cloudron.io/references/cli.html)
```
cloudron install --appstore-id io.gogs.cloudronapp
cloudron install --appstore-id io.gitea.cloudronapp
```
## Building
@@ -17,7 +17,7 @@ cloudron install --appstore-id io.gogs.cloudronapp
The app package can be built using the [Cloudron command line tooling](https://cloudron.io/references/cli.html).
```
cd gogs-app
cd gitea-app
cloudron build
cloudron install
@@ -28,9 +28,9 @@ cloudron install
The e2e tests are located in the `test/` folder and require [nodejs](http://nodejs.org/). They are creating a fresh build, install the app on your Cloudron, perform tests, backup, restore and test if the repos are still ok. The tests expect port 29418 to be available.
```
cd gogs-app/test
cd gitea-app/test
npm install
USERNAME=<cloudron username> PASSWORD=<cloudron password> mocha --bail test.js
PATH=$PATH:node_modules/.bin USERNAME=<cloudron username> PASSWORD=<cloudron password> mocha --bail test.js
```

View File

@@ -1,4 +1,4 @@
APP_NAME = Gogs: Go Git Service
APP_NAME = Gitea
RUN_USER = git
RUN_MODE = prod
@@ -29,7 +29,7 @@ SCRIPT_TYPE = bash
[repository.upload]
ENABLED = true
TEMP_PATH = /run/gogs/tmp/uploads
TEMP_PATH = /run/gitea/tmp/uploads
[release.attachment]
ENABLED = true
@@ -57,7 +57,7 @@ ENABLE_NOTIFY_MAIL = true
; Either "console", "file", "conn", "smtp" or "database", default is "console"
MODE = console
; used for xorm.log
ROOT_PATH = /run/gogs
ROOT_PATH = /run/gitea
[picture]
; APP_DATA_PATH/avatars
@@ -70,3 +70,5 @@ ENABLE = true
; APP_DATA_PATH/attachments
PATH =
[indexer]
ISSUE_INDEXER_PATH = /app/data/appdata/indexers/issues.bleve

BIN
logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View File

@@ -2,14 +2,14 @@
set -eu -o pipefail
mkdir -p /run/gogs/tmp/uploads
mkdir -p /run/gitea/tmp/uploads
setup_ldap_source() {
set -eu
# Wait for gogs to finish db setup, before we insert ldap source in db
# Wait for gitea to finish db setup, before we insert ldap source in db
while ! curl --fail http://localhost:3000/healthcheck; do
echo "Waiting for gogs to come up"
echo "Waiting for gitea to come up"
sleep 1
done
@@ -53,7 +53,7 @@ chmod 0644 /app/data/sshd/*.pub
sed -e "s/^Port .*/Port ${SSH_PORT}/" \
-e "s/^#ListenAddress .*/ListenAddress 0.0.0.0/" \
-e "s,^HostKey /etc/ssh/,HostKey /app/data/sshd/," \
/etc/ssh/sshd_config > /run/gogs/sshd_config
/etc/ssh/sshd_config > /run/gitea/sshd_config
sed -e "s/##DOMAIN/${APP_DOMAIN}/g" \
-e "s/##SSH_PORT/${SSH_PORT}/g" \
@@ -69,16 +69,16 @@ sed -e "s/##DOMAIN/${APP_DOMAIN}/g" \
-e "s/##MAIL_SMTP_USERNAME/${MAIL_SMTP_USERNAME}/g" \
-e "s/##MAIL_SMTP_PASSWORD/${MAIL_SMTP_PASSWORD}/g" \
-e "s/##SECRET_KEY/$(pwgen -1 -s)/g" \
/home/git/app.ini.template > "/run/gogs/app.ini"
/home/git/app.ini.template > "/run/gitea/app.ini"
# merge any user config file
[[ -f /app/data/app.ini ]] && cat "/app/data/app.ini" >> "/run/gogs/app.ini"
[[ -f /app/data/app.ini ]] && cat "/app/data/app.ini" >> "/run/gitea/app.ini"
mkdir -p /app/data/repository /app/data/ssh
chown -R git:git /app/data /run/gogs
chown -R git:git /app/data /run/gitea
( setup_ldap_source ) &
exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Gogs
exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Gitea

View File

@@ -1,6 +1,6 @@
[program:gogs]
directory=/home/git/gogs
command=/home/git/gogs/gogs web -c /run/gogs/app.ini -p 3000
[program:gitea]
directory=/home/git/gitea
command=/home/git/gitea/gitea web -c /run/gitea/app.ini -p 3000
user=git
autostart=true
autorestart=true

View File

@@ -1,6 +1,6 @@
[program:sshd]
directory=/
command=/usr/sbin/sshd -f /run/gogs/sshd_config -D
command=/usr/sbin/sshd -f /run/gitea/sshd_config -D
user=root
autostart=true
autorestart=true

View File

@@ -33,7 +33,7 @@ describe('Application life cycle test', function () {
var app, reponame = 'testrepo';
var username = process.env.USERNAME;
var password = process.env.PASSWORD;
var TIMEOUT = process.env.TIMEOUT || 5000;
var TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 5000;
var email, token;
before(function (done) {
@@ -64,17 +64,17 @@ describe('Application life cycle test', function () {
}
function setAvatar(done) {
browser.get('https://' + app.fqdn + '/user/settings/avatar');
browser.findElement(by.xpath('//input[@type="file" and @name="avatar"]')).sendKeys(path.resolve(__dirname, '../logo.png')).then(function () {
browser.findElement(by.xpath('//button[contains(text(), "Update Avatar Setting")]')).click();
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'));
}).then(function () {
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(); });
});
}
function checkAvatar(done) {
superagent.get('https://' + app.fqdn + '/avatars/1').end(function (error, result) {
superagent.get('https://' + app.fqdn + '/avatars/a3e6f3316fc1738e29d621e6a26e93d3').end(function (error, result) {
expect(error).to.be(null);
expect(result.statusCode).to.be(200);
done();
@@ -82,18 +82,92 @@ describe('Application life cycle test', function () {
}
function editFile(done) {
browser.get('https://' + app.fqdn + '/' + username + '/' + reponame + '/_edit/master/newfile');
var cm = browser.findElement(by.xpath('//div[contains(@class,"CodeMirror")]'));
var text = 'yo';
browser.executeScript('arguments[0].CodeMirror.setValue("' + text + '");', cm).then(function () {
browser.findElement(by.xpath('//input[@name="commit_summary"]')).sendKeys('Dummy edit');
browser.findElement(by.xpath('//button[contains(text(), "Commit Changes")]')).click();
browser.get('https://' + app.fqdn + '/' + username + '/' + reponame + '/_edit/master/newfile').then(function () {
var cm = browser.findElement(by.xpath('//div[contains(@class,"CodeMirror")]'));
var text = 'yo';
return browser.executeScript('arguments[0].CodeMirror.setValue("' + text + '");', cm);
}).then(function () {
return browser.findElement(by.xpath('//input[@name="commit_summary"]')).sendKeys('Dummy edit');
}).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);
});
}
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 () {
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
@@ -121,7 +195,6 @@ describe('Application life cycle test', function () {
});
});
it('install app', function () {
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) {
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 login', login);
it('can set avatar', setAvatar);
it('can get avatar', checkAvatar);
it('can add public key', function (done) {
browser.get('https://' + app.fqdn + '/user/settings/ssh');
var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
it('can add public key', addPublicKey);
browser.findElement(by.xpath('//div[text()="Add Key"]')).click();
browser.findElement(by.id('title')).sendKeys('testkey');
browser.findElement(by.id('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', createRepo);
it('can create repo', function (done) {
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', checkCloneUrl);
it('displays correct clone url', function (done) {
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 clone the url', checkGitClone);
it('can add and push a file', function (done) {
var env = Object.create(process.env);
@@ -207,18 +240,13 @@ describe('Application life cycle test', function () {
it('can edit file', editFile);
it('can restart app', function (done) {
execSync('cloudron restart');
execSync('cloudron restart --wait');
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('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('backup app', function () {
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 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('can clone the url', checkGitClone);
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
it('move to different location', function () {
browser.manage().deleteAllCookies();
@@ -247,33 +268,11 @@ describe('Application life cycle test', function () {
expect(app).to.be.an('object');
});
it('can login', function (done) {
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 login', login);
it('can get avatar', checkAvatar);
it('displays correct clone url', function (done) {
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 });
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
rimraf.sync(repodir);
done();
});
it('displays correct clone url', checkCloneUrl);
it('can clone the url', checkGitClone);
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
it('uninstall app', function () {
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];
expect(app).to.be.an('object');
browser.get('https://' + app.fqdn + '/user/login');
browser.findElement(by.id('user_name')).sendKeys(email);
browser.findElement(by.id('password')).sendKeys(password);
browser.findElement(by.tagName('form')).submit();
browser.wait(until.elementLocated(by.linkText('Dashboard')), TIMEOUT).then(function () {
login(function (error) {
if (error) return done(error);
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
done();
});