2022-02-09 02:21:56 +00:00
|
|
|
stages:
|
2022-02-11 04:12:18 +00:00
|
|
|
# - test
|
2022-02-09 04:52:46 +00:00
|
|
|
- ui
|
2022-02-09 02:21:56 +00:00
|
|
|
- build
|
|
|
|
- deploy
|
2022-02-09 02:28:00 +00:00
|
|
|
- release
|
2022-02-09 02:21:56 +00:00
|
|
|
|
|
|
|
|
2022-02-11 04:12:18 +00:00
|
|
|
# test:
|
|
|
|
# image: "rust:slim-buster"
|
|
|
|
# stage: test
|
|
|
|
# script:
|
|
|
|
# - mkdir dist
|
|
|
|
# - touch dist/index.html
|
|
|
|
# - apt-get update
|
|
|
|
# - apt-get -y install pkg-config
|
|
|
|
# - cargo test
|
2022-02-09 02:21:56 +00:00
|
|
|
|
2022-02-09 04:31:44 +00:00
|
|
|
build-ui:
|
2022-02-09 04:52:46 +00:00
|
|
|
stage: ui
|
2022-02-09 04:06:08 +00:00
|
|
|
image: node:16.13-slim
|
2022-02-09 03:31:35 +00:00
|
|
|
script:
|
2022-02-09 04:07:35 +00:00
|
|
|
- apt-get update
|
|
|
|
- apt-get -y install libssl-dev
|
2022-02-09 03:31:35 +00:00
|
|
|
- npm install
|
2022-02-09 04:31:44 +00:00
|
|
|
- npm run build
|
2022-02-11 03:50:27 +00:00
|
|
|
# rules:
|
|
|
|
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
2022-02-09 03:31:35 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/
|
|
|
|
|
2022-02-11 03:52:03 +00:00
|
|
|
build-x64-bin:
|
2022-02-09 03:31:35 +00:00
|
|
|
dependencies:
|
2022-02-09 04:57:20 +00:00
|
|
|
- build-ui
|
2022-02-09 02:21:56 +00:00
|
|
|
image: "rust:slim-buster"
|
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- linux
|
2022-02-10 14:27:53 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
2022-02-09 02:21:56 +00:00
|
|
|
script:
|
|
|
|
- apt-get update
|
2022-02-10 14:27:53 +00:00
|
|
|
- apt-get -y install libssl-dev pkg-config
|
2022-02-10 05:59:41 +00:00
|
|
|
- cargo build --release
|
2022-02-10 02:33:28 +00:00
|
|
|
- cd target/release
|
2022-02-10 02:58:52 +00:00
|
|
|
- tar -czf ../../vade-linux-x64.tar.gz vade
|
2022-02-10 02:33:28 +00:00
|
|
|
- cd ../../
|
2022-02-09 02:21:56 +00:00
|
|
|
artifacts:
|
2022-02-09 02:25:05 +00:00
|
|
|
paths:
|
|
|
|
- target/release/vade
|
2022-02-10 02:15:36 +00:00
|
|
|
- vade-linux-x64.tar.gz
|
2022-02-09 02:21:56 +00:00
|
|
|
|
2022-02-11 03:30:34 +00:00
|
|
|
|
2022-02-11 03:50:27 +00:00
|
|
|
build-musl-bin:
|
|
|
|
dependencies:
|
|
|
|
- build-ui
|
2022-02-11 03:30:34 +00:00
|
|
|
stage: build
|
|
|
|
image: 'rust:latest'
|
|
|
|
script:
|
|
|
|
- rustup target add x86_64-unknown-linux-musl
|
|
|
|
- apt update && apt install -y musl-tools musl-dev
|
|
|
|
- update-ca-certificates
|
|
|
|
- cargo build --target x86_64-unknown-linux-musl --release
|
2022-02-11 03:50:27 +00:00
|
|
|
- cd target/x86_64-unknown-linux-musl/release/
|
|
|
|
- tar -czf ../../../vade-linux-musl.tar.gz vade
|
|
|
|
- cd ../../../
|
2022-02-11 03:30:34 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- target/x86_64-unknown-linux-musl/release/vade
|
|
|
|
|
2022-02-11 03:52:03 +00:00
|
|
|
build-arm-bin:
|
2022-02-11 03:50:27 +00:00
|
|
|
dependencies:
|
|
|
|
- build-ui
|
|
|
|
stage: build
|
|
|
|
image: 'rust:latest'
|
|
|
|
# rules:
|
|
|
|
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
|
|
script:
|
|
|
|
- rustup target add armv7-unknown-linux-gnueabihf
|
|
|
|
- apt update
|
2022-02-11 04:12:18 +00:00
|
|
|
- apt-get -y install gcc-arm-linux-gnueabihf
|
2022-02-11 04:18:53 +00:00
|
|
|
- cargo build --target armv7-unknown-linux-gnueabihf --release
|
2022-02-11 03:50:27 +00:00
|
|
|
- cd target/armv7-unknown-linux-gnueabihf/release/
|
|
|
|
- tar -czf ../../../vade-linux-arm.tar.gz vade
|
|
|
|
- cd ../../../
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- target/armv7-unknown-linux-gnueabihf/release/vade
|
|
|
|
|
|
|
|
|
2022-02-11 03:53:30 +00:00
|
|
|
build-win-bin:
|
2022-02-11 03:50:27 +00:00
|
|
|
dependencies:
|
|
|
|
- build-ui
|
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- windows
|
|
|
|
# rules:
|
|
|
|
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
|
|
script:
|
|
|
|
- cargo build --release
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- target/release/vade.exe
|
|
|
|
|
2022-02-11 04:18:53 +00:00
|
|
|
deploy-dev-docker:
|
2022-02-09 03:31:35 +00:00
|
|
|
dependencies:
|
2022-02-11 03:50:27 +00:00
|
|
|
- build-musl-bin
|
2022-02-11 04:18:53 +00:00
|
|
|
stage: deploy
|
2022-02-09 06:15:23 +00:00
|
|
|
image: docker:latest
|
2022-02-09 02:21:56 +00:00
|
|
|
script:
|
2022-02-09 03:31:35 +00:00
|
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
2022-02-09 23:57:08 +00:00
|
|
|
- docker build -t $CI_REGISTRY/vade/vade-mecum .
|
|
|
|
- docker push $CI_REGISTRY/vade/vade-mecum
|
2022-02-11 03:30:34 +00:00
|
|
|
# rules:
|
|
|
|
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
2022-02-09 02:28:00 +00:00
|
|
|
|
2022-02-09 04:31:44 +00:00
|
|
|
deploy-binaries:
|
2022-02-09 03:31:35 +00:00
|
|
|
dependencies:
|
2022-02-11 03:52:03 +00:00
|
|
|
- build-x64-bin
|
|
|
|
- build-musl-bin
|
|
|
|
- build-arm-bin
|
|
|
|
- build-win-bin
|
2022-02-09 02:21:56 +00:00
|
|
|
image: curlimages/curl:latest
|
|
|
|
stage: deploy
|
2022-02-10 05:57:54 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
2022-02-09 02:21:56 +00:00
|
|
|
script:
|
2022-02-10 05:57:54 +00:00
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./vade-linux-x64.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-x64-$CI_COMMIT_TAG.tar.gz"'
|
2022-02-11 04:18:53 +00:00
|
|
|
|
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./vade-linux-arm.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-arm-$CI_COMMIT_TAG.tar.gz"'
|
|
|
|
|
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./vade-linux-musl.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-musl-$CI_COMMIT_TAG.tar.gz"'
|
|
|
|
|
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./target/release/vade.exe "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade.exe"'
|
2022-02-09 02:21:56 +00:00
|
|
|
|
|
|
|
release:
|
|
|
|
stage: release
|
|
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
|
|
|
script:
|
|
|
|
- echo "running release_job"
|
|
|
|
release:
|
|
|
|
name: 'Release v$CI_COMMIT_TAG'
|
|
|
|
description: 'Version $CI_COMMIT_TAG'
|
|
|
|
tag_name: '$CI_COMMIT_TAG'
|
|
|
|
ref: '$CI_COMMIT_TAG'
|
|
|
|
assets:
|
|
|
|
links:
|
2022-02-10 00:25:16 +00:00
|
|
|
- name: 'vade-linux-x64-$CI_COMMIT_TAG.tar.gz'
|
2022-02-09 03:46:02 +00:00
|
|
|
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-bin/$CI_COMMIT_TAG/vade-linux-x64-$CI_COMMIT_TAG.tar.gz'
|