nextcloud-app-radio/.gitlab-ci.yml
2020-12-02 14:05:15 +01:00

81 lines
3.0 KiB
YAML

stages:
- compiling
- testing
- packaging
- signing
- publishing
image: node:latest
compiling:
stage: compiling
script:
- npm install
- make build-js
cache:
paths:
- node_modules/
testing:
stage: testing
image: nextcloud:fpm
script:
- ls
- cp -r /builds/project-0 /usr/src/nextcloud/apps/radio
- php /usr/src/nextcloud/occ maintenance:install --database "sqlite" --admin-user "admin" --admin-pass "password"
- php /usr/src/nextcloud/occ app:enable radio
- php /usr/src/nextcloud/occ maintenance:mode --off
- php /usr/src/nextcloud/occ app:check-code radio
# - jshint --verbose radio/src/dashboard.js && echo "jshint OK" || echo "jshint has complaints"
# - jshint --verbose radio/src/main.js && echo "jshint OK" || echo "jshint has complaints"
# - jshint --verbose radio/src/router.js && echo "jshint OK" || echo "jshint has complaints"
# - jshint --verbose radio/src/store.js && echo "jshint OK" || echo "jshint has complaints"
# - phpunit --configuration /var/www/html/nextcloud/apps/cospend/phpunit.xml --coverage-text --color=never --coverage-html coverage
packaging:
stage: packaging
script:
- apt update
- DEBIAN_FRONTEND="noninteractive" apt install -y wget sudo
- wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u12_amd64.deb
- wget https://github.com/ChristophWurst/krankerl/releases/download/v0.12.3/krankerl_0.12.3_amd64.deb
- sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u12_amd64.deb krankerl_0.12.3_amd64.deb
- krankerl package
artifacts:
paths:
- build/artifacts/radio.tar.gz
signing:
stage: signing
image: nextcloud:fpm
script:
- echo "-----BEGIN PRIVATE KEY-----" > sign.key
- echo $SIGN_KEY | tr " " "\n" >> sign.key
- echo "-----END PRIVATE KEY-----" >> sign.key
- echo "-----BEGIN CERTIFICATE-----" > sign.crt
- echo $SIGN_CRT | tr " " "\n" >> sign.crt
- echo "-----END CERTIFICATE-----" >> sign.crt
- tar xvf build/artifacts/radio.tar.gz
- php /usr/src/nextcloud/occ integrity:sign-app --path=$(pwd)/radio --privateKey=$(pwd)/sign.key --certificate=$(pwd)/sign.crt
- tar -czvf build/artifacts/radio.tar.gz radio
- rm -r sign.key sign.crt radio
- echo CI_PACKAGING_JOBID="${CI_JOB_ID}" > $CI_PROJECT_DIR/variables.env
artifacts:
paths:
- build/artifacts/radio.tar.gz
expire_in: never
reports:
dotenv: variables.env
publishing:
stage: publishing
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- EXTRA_DESCRIPTION="$(sed '1,/^## /!d;/^## /d' CHANGELOG.md)";
- >
release-cli create --name "v$CI_COMMIT_TAG" --description "$EXTRA_DESCRIPTION"
--tag-name $CI_COMMIT_TAG --ref $CI_COMMIT_SHA
--assets-link "{\"name\":\"radio\",\"url\":\"https://git.project-insanity.org/onny/nextcloud-app-radio/-/jobs/${CI_PACKAGING_JOBID}/artifacts/raw/build/artifacts/radio.tar.gz\",\"link_type\":\"other\"}"