ci: Replace CircleCI configuration with GitLab CI configuration

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Joseph Nuthalapati 2018-01-26 11:23:31 +05:30 committed by Sunil Mohan Adapa
parent de45c39979
commit 8a7eb0f274
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 34 additions and 69 deletions

View File

@ -1,69 +0,0 @@
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# CircleCI 2.0 configuration file for Plinth
version: 2
jobs:
build:
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
- image: debian:unstable
working_directory: ~/Plinth
steps:
- checkout
- run:
name: install plinth dependencies
command: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
# Dependencies of the plinth Debian package
apt-get build-dep -y .
# Build dependencies
apt-get install -y build-essential
# Test dependencies
apt-get install -y sshpass parted
# Module dependencies
cd ~/Plinth
apt-get install -y $(./run --list-dependencies)
- run:
name: run Debian build
# FIXME: enable testing after flagging integration tests
command: DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b
- run:
name: run integration tests
command: |
adduser tester --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password
echo "tester:password" | chpasswd
cp -r ~/Plinth /home/tester
chown -R tester:tester /home/tester/Plinth
su -c "cd ~/Plinth; ./setup.py test" tester
# We'll generate test reports once Pytest is integrated
# - store_artifacts:
# path: test-reports
# destination: test-reports

34
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,34 @@
image: debian:unstable
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- apt-get build-dep -y . # Dependencies of the plinth Debian package
- apt-get install -y build-essential # Build dependencies
- apt-get install -y sshpass parted # Test dependencies
- apt-get install -y sudo
- apt-get install -y $(./run --list-dependencies) # Module dependencies
stages:
- test
- package
run-unit-tests:
stage: test
script:
- adduser tester --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password
- echo "tester:password" | chpasswd
- cp -r . /home/tester/plinth
- chown -R tester:tester /home/tester/plinth
- su -c "cd ~/plinth; python3 setup.py test" tester
build-debian-package:
stage: package
script:
- DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b
- mkdir debian-package
- mv ../plinth*.deb debian-package
artifacts:
paths:
- debian-package/*