2020-10-13 09:31:35 +00:00
|
|
|
stages:
|
|
|
|
- compiling
|
2020-12-02 12:44:53 +00:00
|
|
|
- testing
|
2020-11-26 10:00:15 +00:00
|
|
|
- packaging
|
2020-11-29 10:07:27 +00:00
|
|
|
- signing
|
2020-11-26 10:00:15 +00:00
|
|
|
- publishing
|
2020-10-13 09:31:35 +00:00
|
|
|
|
2020-11-26 10:34:38 +00:00
|
|
|
image: node:latest
|
2020-10-13 09:31:35 +00:00
|
|
|
|
2020-12-03 10:26:30 +00:00
|
|
|
variables:
|
|
|
|
APP_NAME: "radio"
|
|
|
|
|
2020-11-27 09:49:38 +00:00
|
|
|
compiling:
|
2020-10-13 09:31:35 +00:00
|
|
|
stage: compiling
|
|
|
|
script:
|
2020-12-03 10:09:19 +00:00
|
|
|
- apt update
|
2020-12-03 10:26:30 +00:00
|
|
|
- DEBIAN_FRONTEND="noninteractive" apt install -y gettext php php-simplexml
|
2020-11-27 09:49:38 +00:00
|
|
|
- npm install
|
2020-11-26 09:59:14 +00:00
|
|
|
- make build-js
|
2020-12-03 10:07:03 +00:00
|
|
|
- make translations
|
2020-12-02 13:14:27 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- ./l10n/*
|
|
|
|
- ./js/*
|
2020-11-26 10:18:41 +00:00
|
|
|
cache:
|
2020-10-13 09:31:35 +00:00
|
|
|
paths:
|
2020-11-26 10:18:41 +00:00
|
|
|
- node_modules/
|
2020-10-13 09:31:35 +00:00
|
|
|
|
2020-12-02 12:44:53 +00:00
|
|
|
testing:
|
|
|
|
stage: testing
|
2020-12-02 13:05:15 +00:00
|
|
|
image: nextcloud:fpm
|
2020-12-02 12:44:53 +00:00
|
|
|
script:
|
2020-12-03 10:26:30 +00:00
|
|
|
- cp -r $(pwd) /usr/src/nextcloud/apps/${APP_NAME}
|
2020-12-02 12:44:53 +00:00
|
|
|
- php /usr/src/nextcloud/occ maintenance:install --database "sqlite" --admin-user "admin" --admin-pass "password"
|
2020-12-03 10:26:30 +00:00
|
|
|
- php /usr/src/nextcloud/occ app:enable ${APP_NAME}
|
2020-12-02 12:44:53 +00:00
|
|
|
- php /usr/src/nextcloud/occ maintenance:mode --off
|
2020-12-03 10:26:30 +00:00
|
|
|
- php /usr/src/nextcloud/occ app:check-code ${APP_NAME}
|
2020-12-03 10:59:06 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- ./l10n/*
|
|
|
|
- ./js/*
|
2020-12-02 12:44:53 +00:00
|
|
|
|
2020-11-27 09:49:38 +00:00
|
|
|
packaging:
|
2020-10-13 09:31:35 +00:00
|
|
|
stage: packaging
|
|
|
|
script:
|
2020-11-26 10:34:38 +00:00
|
|
|
- apt update
|
2020-12-05 08:58:31 +00:00
|
|
|
- DEBIAN_FRONTEND="noninteractive" apt install -y wget sudo gettext php php-simplexml
|
2021-03-09 12:05:27 +00:00
|
|
|
- wget https://github.com/ChristophWurst/krankerl/releases/download/v0.13.0/krankerl_0.13.0_amd64.deb
|
2021-03-09 12:15:29 +00:00
|
|
|
- sudo dpkg -i krankerl_0.13.0_amd64.deb
|
2020-11-26 10:18:41 +00:00
|
|
|
- krankerl package
|
2020-10-13 09:31:35 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-12-03 10:26:30 +00:00
|
|
|
- build/artifacts/${APP_NAME}.tar.gz
|
2020-10-13 09:31:35 +00:00
|
|
|
|
2020-11-29 10:07:27 +00:00
|
|
|
signing:
|
|
|
|
stage: signing
|
2020-12-01 15:08:57 +00:00
|
|
|
image: nextcloud:fpm
|
2020-11-29 10:07:27 +00:00
|
|
|
script:
|
2020-11-30 14:29:21 +00:00
|
|
|
- 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
|
2020-12-03 10:26:30 +00:00
|
|
|
- tar xvf build/artifacts/${APP_NAME}.tar.gz
|
|
|
|
- php /usr/src/nextcloud/occ integrity:sign-app --path=$(pwd)/${APP_NAME} --privateKey=$(pwd)/sign.key --certificate=$(pwd)/sign.crt
|
|
|
|
- tar -czvf build/artifacts/${APP_NAME}.tar.gz ${APP_NAME}
|
|
|
|
- rm -r sign.key sign.crt ${APP_NAME}
|
2020-11-30 14:46:15 +00:00
|
|
|
- echo CI_PACKAGING_JOBID="${CI_JOB_ID}" > $CI_PROJECT_DIR/variables.env
|
2020-11-30 14:39:20 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-12-03 10:26:30 +00:00
|
|
|
- build/artifacts/${APP_NAME}.tar.gz
|
2020-11-30 14:39:20 +00:00
|
|
|
expire_in: never
|
2020-11-30 14:46:15 +00:00
|
|
|
reports:
|
|
|
|
dotenv: variables.env
|
2020-11-29 10:07:27 +00:00
|
|
|
|
2020-11-27 09:49:38 +00:00
|
|
|
publishing:
|
2020-10-13 09:31:35 +00:00
|
|
|
stage: publishing
|
2020-11-26 10:18:41 +00:00
|
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
2020-11-27 09:59:17 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
2020-10-13 09:31:35 +00:00
|
|
|
script:
|
2020-11-28 08:27:02 +00:00
|
|
|
- EXTRA_DESCRIPTION="$(sed '1,/^## /!d;/^## /d' CHANGELOG.md)";
|
2020-11-26 10:18:41 +00:00
|
|
|
- >
|
2020-11-27 10:23:13 +00:00
|
|
|
release-cli create --name "v$CI_COMMIT_TAG" --description "$EXTRA_DESCRIPTION"
|
2020-11-26 10:18:41 +00:00
|
|
|
--tag-name $CI_COMMIT_TAG --ref $CI_COMMIT_SHA
|
2020-12-03 10:26:30 +00:00
|
|
|
--assets-link "{\"name\":\"${APP_NAME}\",\"url\":\"https://git.project-insanity.org/onny/nextcloud-app-radio/-/jobs/${CI_PACKAGING_JOBID}/artifacts/raw/build/artifacts/${APP_NAME}.tar.gz\",\"link_type\":\"other\"}"
|