further work on CI: compile stage

This commit is contained in:
Jonas Heinrich 2020-12-03 11:26:30 +01:00
parent ca5fec6776
commit d261ba1de4

View File

@ -7,11 +7,14 @@ stages:
image: node:latest image: node:latest
variables:
APP_NAME: "radio"
compiling: compiling:
stage: compiling stage: compiling
script: script:
- apt update - apt update
- DEBIAN_FRONTEND="noninteractive" apt install -y php gettext - DEBIAN_FRONTEND="noninteractive" apt install -y gettext php php-simplexml
- npm install - npm install
- make build-js - make build-js
- make translations - make translations
@ -27,11 +30,11 @@ testing:
stage: testing stage: testing
image: nextcloud:fpm image: nextcloud:fpm
script: script:
- cp -r $(pwd) /usr/src/nextcloud/apps/radio - cp -r $(pwd) /usr/src/nextcloud/apps/${APP_NAME}
- php /usr/src/nextcloud/occ maintenance:install --database "sqlite" --admin-user "admin" --admin-pass "password" - 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 app:enable ${APP_NAME}
- php /usr/src/nextcloud/occ maintenance:mode --off - php /usr/src/nextcloud/occ maintenance:mode --off
- php /usr/src/nextcloud/occ app:check-code radio - php /usr/src/nextcloud/occ app:check-code ${APP_NAME}
packaging: packaging:
stage: packaging stage: packaging
@ -44,7 +47,7 @@ packaging:
- krankerl package - krankerl package
artifacts: artifacts:
paths: paths:
- build/artifacts/radio.tar.gz - build/artifacts/${APP_NAME}.tar.gz
signing: signing:
stage: signing stage: signing
@ -56,14 +59,14 @@ signing:
- echo "-----BEGIN CERTIFICATE-----" > sign.crt - echo "-----BEGIN CERTIFICATE-----" > sign.crt
- echo $SIGN_CRT | tr " " "\n" >> sign.crt - echo $SIGN_CRT | tr " " "\n" >> sign.crt
- echo "-----END CERTIFICATE-----" >> sign.crt - echo "-----END CERTIFICATE-----" >> sign.crt
- tar xvf build/artifacts/radio.tar.gz - tar xvf build/artifacts/${APP_NAME}.tar.gz
- php /usr/src/nextcloud/occ integrity:sign-app --path=$(pwd)/radio --privateKey=$(pwd)/sign.key --certificate=$(pwd)/sign.crt - php /usr/src/nextcloud/occ integrity:sign-app --path=$(pwd)/${APP_NAME} --privateKey=$(pwd)/sign.key --certificate=$(pwd)/sign.crt
- tar -czvf build/artifacts/radio.tar.gz radio - tar -czvf build/artifacts/${APP_NAME}.tar.gz ${APP_NAME}
- rm -r sign.key sign.crt radio - rm -r sign.key sign.crt ${APP_NAME}
- echo CI_PACKAGING_JOBID="${CI_JOB_ID}" > $CI_PROJECT_DIR/variables.env - echo CI_PACKAGING_JOBID="${CI_JOB_ID}" > $CI_PROJECT_DIR/variables.env
artifacts: artifacts:
paths: paths:
- build/artifacts/radio.tar.gz - build/artifacts/${APP_NAME}.tar.gz
expire_in: never expire_in: never
reports: reports:
dotenv: variables.env dotenv: variables.env
@ -78,4 +81,4 @@ publishing:
- > - >
release-cli create --name "v$CI_COMMIT_TAG" --description "$EXTRA_DESCRIPTION" release-cli create --name "v$CI_COMMIT_TAG" --description "$EXTRA_DESCRIPTION"
--tag-name $CI_COMMIT_TAG --ref $CI_COMMIT_SHA --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\"}" --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\"}"