2019-06-03 23:09:16 +07:00
|
|
|
include:
|
|
|
|
- template: Dependency-Scanning.gitlab-ci.yml
|
|
|
|
- template: SAST.gitlab-ci.yml
|
|
|
|
|
2019-02-28 19:52:24 +07:00
|
|
|
stages:
|
2019-06-03 23:09:16 +07:00
|
|
|
- test
|
2019-02-28 19:52:24 +07:00
|
|
|
- install
|
|
|
|
- package
|
|
|
|
- installer
|
2019-07-31 03:57:40 +07:00
|
|
|
- release-note
|
|
|
|
- release
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
## TEST
|
|
|
|
###############################################################################
|
2019-06-03 23:09:16 +07:00
|
|
|
|
2019-07-05 16:35:30 +07:00
|
|
|
code_quality:
|
|
|
|
stage: test
|
|
|
|
image: docker:stable
|
|
|
|
allow_failure: true
|
|
|
|
services:
|
|
|
|
- docker:stable-dind
|
|
|
|
variables:
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
script:
|
|
|
|
- |
|
|
|
|
if ! docker info &>/dev/null; then
|
|
|
|
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
|
|
|
|
export DOCKER_HOST='tcp://localhost:2375'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
- docker run
|
|
|
|
--env CODECLIMATE_CODE="$PWD"
|
|
|
|
--volume "$PWD":/code
|
|
|
|
--volume /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
--volume /tmp/cc:/tmp/cc
|
|
|
|
--entrypoint "/bin/sh" codeclimate/codeclimate -c "/usr/src/app/bin/codeclimate engines:install && /usr/src/app/bin/codeclimate analyze"
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-07-05 16:35:30 +07:00
|
|
|
except:
|
|
|
|
variables:
|
|
|
|
- $CODE_QUALITY_DISABLED
|
|
|
|
|
2019-06-03 23:09:16 +07:00
|
|
|
dependency_scanning:
|
|
|
|
stage: test
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-06-03 23:09:16 +07:00
|
|
|
except: []
|
|
|
|
|
|
|
|
sast:
|
|
|
|
stage: test
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-06-03 23:09:16 +07:00
|
|
|
except: []
|
2019-02-28 19:52:24 +07:00
|
|
|
|
2019-06-03 17:17:13 +07:00
|
|
|
js_syntax:
|
2019-06-03 23:09:16 +07:00
|
|
|
stage: test
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-06-03 17:17:13 +07:00
|
|
|
image: node:carbon
|
|
|
|
tags: [ docker ]
|
2019-06-03 23:09:16 +07:00
|
|
|
cache: {}
|
|
|
|
dependencies: []
|
2019-06-03 17:17:13 +07:00
|
|
|
before_script:
|
|
|
|
- npm install -g acorn
|
2019-06-03 19:15:22 +07:00
|
|
|
- rm -rf node_modules
|
2019-06-03 17:17:13 +07:00
|
|
|
script:
|
|
|
|
- find . -iname "*.js" -print0 | xargs -0 -I % sh -c 'echo "%"; acorn --ecma6 --silent "%"'
|
|
|
|
|
2019-08-04 15:02:03 +07:00
|
|
|
release-check:
|
|
|
|
tags: [ docker ]
|
|
|
|
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.20.4
|
|
|
|
only:
|
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
|
|
|
stage: test
|
|
|
|
dependencies: []
|
|
|
|
script:
|
|
|
|
- release next-version > .next_version
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- .next_version
|
|
|
|
|
2019-07-31 03:57:40 +07:00
|
|
|
###############################################################################
|
|
|
|
## INSTALL
|
|
|
|
###############################################################################
|
|
|
|
|
2019-02-28 19:52:24 +07:00
|
|
|
node:
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-02-28 19:52:24 +07:00
|
|
|
stage: install
|
|
|
|
tags: [ docker ]
|
|
|
|
image: electronuserland/builder:wine-mono
|
2019-08-04 15:02:03 +07:00
|
|
|
dependencies:
|
|
|
|
- release-check
|
2019-02-28 19:52:24 +07:00
|
|
|
script:
|
2019-08-04 15:02:03 +07:00
|
|
|
- VERSION=`cat .next_version`
|
|
|
|
- npm version --no-git-tag-version ${VERSION}
|
2019-02-28 19:52:24 +07:00
|
|
|
- npm install
|
2019-07-25 23:03:06 +07:00
|
|
|
- cp vendor/7z/7z.exe node_modules/electron-winstaller/vendor/7z.exe
|
|
|
|
- cp vendor/7z/7z.dll node_modules/electron-winstaller/vendor/7z.dll
|
2019-02-28 19:52:24 +07:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- node_modules/
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- node_modules/
|
2019-08-04 15:02:03 +07:00
|
|
|
- package.json
|
|
|
|
- package-lock.json
|
2019-02-28 19:52:24 +07:00
|
|
|
|
2019-07-31 03:57:40 +07:00
|
|
|
###############################################################################
|
|
|
|
## PACKAGE
|
|
|
|
###############################################################################
|
|
|
|
|
2019-02-28 19:52:24 +07:00
|
|
|
win32:
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-02-28 19:52:24 +07:00
|
|
|
stage: package
|
|
|
|
tags: [ docker ]
|
|
|
|
image: electronuserland/builder:wine-mono
|
|
|
|
script:
|
2019-07-25 23:03:06 +07:00
|
|
|
- rm -rf vendor/*
|
2019-03-11 20:40:26 +07:00
|
|
|
- npm run-script package-win32
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- release-builds/
|
|
|
|
dependencies:
|
|
|
|
- node
|
|
|
|
|
|
|
|
linux:
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-03-11 20:40:26 +07:00
|
|
|
stage: package
|
|
|
|
tags: [ docker ]
|
|
|
|
image: electronuserland/builder:wine-mono
|
|
|
|
script:
|
2019-06-03 18:07:16 +07:00
|
|
|
- rm -rf bin/*
|
2019-03-11 20:40:26 +07:00
|
|
|
- npm run-script package-linux
|
2019-02-28 19:52:24 +07:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- release-builds/
|
|
|
|
dependencies:
|
|
|
|
- node
|
|
|
|
|
2019-07-31 03:57:40 +07:00
|
|
|
###############################################################################
|
|
|
|
## INSTALLER
|
|
|
|
###############################################################################
|
|
|
|
|
2019-07-29 20:59:37 +07:00
|
|
|
exe-installer:
|
2019-02-28 19:52:24 +07:00
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-02-28 19:52:24 +07:00
|
|
|
stage: installer
|
|
|
|
tags: [ docker ]
|
2019-07-05 17:53:00 +07:00
|
|
|
image: docker:stable
|
|
|
|
services:
|
|
|
|
- docker:stable-dind
|
|
|
|
variables:
|
|
|
|
DOCKER_DRIVER: overlay2
|
2019-02-28 19:52:24 +07:00
|
|
|
script:
|
2019-07-05 17:53:00 +07:00
|
|
|
- |
|
|
|
|
if ! docker info &>/dev/null; then
|
|
|
|
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
|
|
|
|
export DOCKER_HOST='tcp://localhost:2375'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
- mkdir installer-builds
|
|
|
|
- chmod 777 installer-builds
|
|
|
|
- docker run
|
|
|
|
--env ELECTRON_CACHE="/root/.cache/electron"
|
|
|
|
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder"
|
|
|
|
-v ${PWD}:/project
|
|
|
|
-v ~/.cache/electron:/root/.cache/electron
|
|
|
|
-v ~/.cache/electron-builder:/root/.cache/electron-builder
|
2019-07-25 23:18:18 +07:00
|
|
|
electronuserland/builder:wine-mono /bin/bash -c "npm run-script build-exe"
|
2019-07-05 17:53:00 +07:00
|
|
|
- ls installer-builds/RyzenControllerInstaller.exe
|
2019-07-31 03:57:40 +07:00
|
|
|
- echo "https://gitlab.com/ryzen-controller-team/ryzen-controller/-/jobs/${CI_JOB_ID}/artifacts/browse/installer-builds/" > .exe_link
|
2019-02-28 19:52:24 +07:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- installer-builds/
|
2019-07-31 03:57:40 +07:00
|
|
|
- .exe_link
|
2019-02-28 19:52:24 +07:00
|
|
|
dependencies:
|
|
|
|
- node
|
|
|
|
- win32
|
2019-03-11 20:40:26 +07:00
|
|
|
|
|
|
|
deb-installer:
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-03-11 20:40:26 +07:00
|
|
|
stage: installer
|
|
|
|
tags: [ docker ]
|
|
|
|
image: debian:stretch
|
|
|
|
before_script:
|
|
|
|
- apt update -y
|
|
|
|
- apt install fakeroot curl -y
|
|
|
|
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
|
|
|
|
- export NVM_DIR="$HOME/.nvm"
|
|
|
|
- '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"'
|
|
|
|
- nvm install 10.15.1
|
|
|
|
- nvm use 10.15.1
|
2019-07-31 03:57:40 +07:00
|
|
|
- echo "https://gitlab.com/ryzen-controller-team/ryzen-controller/-/jobs/${CI_JOB_ID}/artifacts/browse/installer-builds/installers/" > .deb_link
|
2019-03-11 20:40:26 +07:00
|
|
|
script:
|
|
|
|
- npm run-script build-deb
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- installer-builds/
|
2019-07-31 03:57:40 +07:00
|
|
|
- .deb_link
|
2019-03-11 20:40:26 +07:00
|
|
|
dependencies:
|
|
|
|
- node
|
|
|
|
- linux
|
|
|
|
|
|
|
|
rpm-installer:
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-03-11 20:40:26 +07:00
|
|
|
stage: installer
|
|
|
|
tags: [ docker ]
|
|
|
|
image: electronuserland/builder:wine-mono
|
|
|
|
script:
|
|
|
|
- npm run-script build-rpm
|
2019-07-31 03:57:40 +07:00
|
|
|
- echo "https://gitlab.com/ryzen-controller-team/ryzen-controller/-/jobs/${CI_JOB_ID}/artifacts/browse/installer-builds/installers/" > .rpm_link
|
2019-03-11 20:40:26 +07:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- installer-builds/
|
2019-07-31 03:57:40 +07:00
|
|
|
- .rpm_link
|
2019-03-11 20:40:26 +07:00
|
|
|
dependencies:
|
|
|
|
- node
|
|
|
|
- linux
|
2019-07-31 03:57:40 +07:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
## RELEASE-NOTE
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
create-rpm-link:
|
|
|
|
tags: [ docker ]
|
|
|
|
image: alpine
|
|
|
|
stage: release-note
|
|
|
|
dependencies:
|
|
|
|
- rpm-installer
|
|
|
|
- release-check
|
|
|
|
only:
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
|
|
|
before_script:
|
|
|
|
- apk add curl jq
|
|
|
|
script:
|
|
|
|
- URL=`cat .rpm_link`
|
|
|
|
- VERSION=`cat .next_version`
|
|
|
|
- VERSION_ESCAPED=`echo $VERSION | tr '.' '-'`
|
|
|
|
- curl -H "Content-Type:application/json"
|
|
|
|
-X POST
|
|
|
|
-H "Authorization:Bearer ${BL_TOKEN}"
|
|
|
|
-d "{\"title\":\"${VERSION} rpm\",\"tags\":[\"RC_rpm\",\"RC_${VERSION_ESCAPED}\",\"RC\"],\"long_url\":\"${URL}\",\"group_guid\":\"Bj4p9bnMV93\"}"
|
|
|
|
"https://api-ssl.bitly.com/v4/bitlinks" > .rpm_res.json
|
|
|
|
- cat .rpm_res.json | jq -e -r .link > .rpm_short_link
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- .rpm_short_link
|
|
|
|
- .rpm_res.json
|
|
|
|
|
|
|
|
create-deb-link:
|
|
|
|
tags: [ docker ]
|
|
|
|
image: alpine
|
|
|
|
stage: release-note
|
|
|
|
dependencies:
|
|
|
|
- deb-installer
|
|
|
|
- release-check
|
|
|
|
only:
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
|
|
|
before_script:
|
|
|
|
- apk add curl jq
|
|
|
|
script:
|
|
|
|
- URL=`cat .deb_link`
|
|
|
|
- VERSION=`cat .next_version`
|
|
|
|
- VERSION_ESCAPED=`echo $VERSION | tr '.' '-'`
|
|
|
|
- curl -H "Content-Type:application/json"
|
|
|
|
-X POST
|
|
|
|
-H "Authorization:Bearer ${BL_TOKEN}"
|
|
|
|
-d "{\"title\":\"${VERSION} deb\",\"tags\":[\"RC_deb\",\"RC_${VERSION_ESCAPED}\",\"RC\"],\"long_url\":\"${URL}\",\"group_guid\":\"Bj4p9bnMV93\"}"
|
|
|
|
"https://api-ssl.bitly.com/v4/bitlinks" > .deb_res.json
|
|
|
|
- cat .deb_res.json | jq -e -r .link > .deb_short_link
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- .deb_short_link
|
|
|
|
- .deb_res.json
|
|
|
|
|
|
|
|
create-exe-link:
|
|
|
|
tags: [ docker ]
|
|
|
|
image: alpine
|
|
|
|
stage: release-note
|
|
|
|
dependencies:
|
|
|
|
- exe-installer
|
|
|
|
- release-check
|
|
|
|
only:
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
|
|
|
before_script:
|
|
|
|
- apk add curl jq
|
|
|
|
script:
|
|
|
|
- URL=`cat .exe_link`
|
|
|
|
- VERSION=`cat .next_version`
|
|
|
|
- VERSION_ESCAPED=`echo $VERSION | tr '.' '-'`
|
|
|
|
- curl -H "Content-Type:application/json"
|
|
|
|
-X POST
|
|
|
|
-H "Authorization:Bearer ${BL_TOKEN}"
|
|
|
|
-d "{\"title\":\"${VERSION} exe\",\"tags\":[\"RC_exe\",\"RC_${VERSION_ESCAPED}\",\"RC\"],\"long_url\":\"${URL}\",\"group_guid\":\"Bj4p9bnMV93\"}"
|
|
|
|
"https://api-ssl.bitly.com/v4/bitlinks" > .exe_res.json
|
|
|
|
- cat .exe_res.json | jq -e -r .link > .exe_short_link
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- .exe_short_link
|
|
|
|
- .exe_res.json
|
|
|
|
|
|
|
|
update-changelog:
|
|
|
|
tags: [ docker ]
|
|
|
|
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.20.4
|
|
|
|
only:
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
|
|
|
stage: release-note
|
|
|
|
script:
|
|
|
|
- release changelog
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- CHANGELOG.md
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
## RELEASE
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
publish:
|
|
|
|
tags: [ docker ]
|
|
|
|
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.20.4
|
|
|
|
only:
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
|
|
|
stage: release
|
|
|
|
dependencies:
|
|
|
|
- release-check
|
2019-08-04 15:02:03 +07:00
|
|
|
- node
|
2019-07-31 03:57:40 +07:00
|
|
|
- create-rpm-link
|
|
|
|
- create-deb-link
|
|
|
|
- create-exe-link
|
|
|
|
- update-changelog
|
|
|
|
script:
|
|
|
|
- VERSION=`cat .next_version`
|
|
|
|
- release --ci-commit-tag ${VERSION} commit-and-tag CHANGELOG.md package.json package-lock.json
|
|
|
|
- release --ci-commit-tag ${VERSION} add-download-link -d "Debian installer (and variant)" -n "ryzencontroller_${VERSION}_amd64.deb" -u "`cat .deb_short_link`"
|
|
|
|
- release --ci-commit-tag ${VERSION} add-download-link -d "Redhat installer (and variant)" -n "ryzencontroller_${VERSION}.amd64.rpm" -u "`cat .rpm_short_link`"
|
|
|
|
- release --ci-commit-tag ${VERSION} add-download-link -d "Windows installer" -n "RyzenControllerInstaller.exe" -u "`cat .exe_short_link`"
|