Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Truite
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EcoMobiCoin
Truite
Commits
b3bb4535
Commit
b3bb4535
authored
1 year ago
by
Jerome DESCHAMPS
Browse files
Options
Downloads
Plain Diff
Merge branch '121-add-release-process' into 'dev'
Update gitlab ci with release Closes #121 See merge request
!90
parents
2fa4a2d0
a8ea90d8
No related branches found
Branches containing commit
Tags
v0.0.1-prealpha1
Tags containing commit
1 merge request
!90
Update gitlab ci with release
Pipeline
#6035
failed
1 year ago
Stage: lint
Stage: build
Stage: test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+92
-34
92 additions, 34 deletions
.gitlab-ci.yml
with
92 additions
and
34 deletions
.gitlab-ci.yml
+
92
−
34
View file @
b3bb4535
image
:
gitlab.limos.fr:5005/ecomobicoin/infra/rust-builder-image:1.71
cache
:
paths
:
-
target/
variables
:
PACKAGE_REGISTRY_URL
:
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic
before_script
:
-
|
# skip if not using custom Rust image
if hash rustc 2>/dev/null; then
rustc --version
cargo --version
fi
stages
:
-
lint
-
build
-
test
-
release-build
-
release
-
deploy
image
:
gitlab.limos.fr:5005/angraign/rust-ci-image:1.71
# image: rust:latest
before_script
:
-
rustc --version && cargo --version
# variables:
# CARGO_HOME: $CI_PROJECT_DIR/.cargo
#cache:
# paths:
# - target/
# cache:
# key: one-key-to-rule-them-all
# paths:
# - $CARGO_HOME/bin
# - $CARGO_HOME/registry/index
# - $CARGO_HOME/registry/cache
# - $CARGO_HOME/git/db
lint
:
stage
:
lint
script
:
...
...
@@ -104,26 +103,84 @@ package-docker:
-
if
:
$CI_COMMIT_BRANCH
exists
:
-
Dockerfile
# release:
# stage: release
# image: registry.gitlab.com/gitlab-org/release-cli:latest
# variables:
# LINUX_ASSET_LINK: '{"name":"gitlab-downloader-linux-86_64-${CI_COMMIT_TAG}","url":"${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/linux-x86_64/gitlab-downloader","type":"package"}'
# release-build-apple:
# stage: release-build
# script:
# - echo "Releasing..."
# - echo "Tag = ${CI_COMMIT_TAG}"
# - echo "URL = ${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}"
# - echo "LINUX = ${LINUX_ASSET_LINK}"
# - echo "WIN = ${WIN_ASSET_LINK}"
# # x64 Mac
# - cargo build --target x86_64-apple-darwin --workspace --profile=production
# - |
# curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "target/x86_64-apple-darwin/production/truite" "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/apple-x86_64/truite"
# # ARM Mac e.g. Macbook Pro with M1
# - cargo build --target aarch64-apple-darwin --workspace --profile=production
# - |
# release-cli --debug create --name "Release ${CI_COMMIT_TAG}" --tag-name "${CI_COMMIT_TAG}" --assets-link "${LINUX_ASSET_LINK}" --assets-link "${WIN_ASSET_LINK}"
# - echo "Done!"
# needs:
# - job: build
# artifacts: true
# curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "target/aarch64-apple-darwin/production/truite" "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/apple-aarch64/truite"
# rules:
# - if:
'
$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v
[0-9]\.[0-9]\.[0-9](-rc.+)?/'
# - if:
"
$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v
/"
# when: always
# tags:
# - ecomobicoin
release-build-linux
:
stage
:
release-build
script
:
-
cargo build --target x86_64-unknown-linux-gnu --workspace --profile=production
-
|
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "target/x86_64-unknown-linux-gnu/production/truite" "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/linux-x86_64/truite"
rules
:
-
if
:
"
$CI_COMMIT_TAG
&&
$CI_COMMIT_TAG
=~
/^v/"
when
:
always
tags
:
-
ecomobicoin
release-docker
:
stage
:
release-build
image
:
docker:latest
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
variables
:
CONTAINER_COMMIT_IMAGE
:
"
${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}"
CONTAINER_RELEASE_IMAGE
:
"
${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
script
:
-
echo "Building docker image... (CONTAINER_COMMIT_IMAGE = ${CONTAINER_COMMIT_IMAGE}, CONTAINER_RELEASE_IMAGE = ${CONTAINER_RELEASE_IMAGE})"
-
docker build --pull -t $CONTAINER_COMMIT_IMAGE .
-
docker tag $CONTAINER_COMMIT_IMAGE $CONTAINER_RELEASE_IMAGE
-
docker push $CONTAINER_RELEASE_IMAGE
rules
:
-
if
:
"
$CI_COMMIT_TAG
&&
$CI_COMMIT_TAG
=~
/^v/"
when
:
always
tags
:
-
ecomobicoin
release
:
stage
:
release
image
:
registry.gitlab.com/gitlab-org/release-cli:latest
variables
:
LINUX_ASSET_LINK
:
'
{"name":"truite-linux-86_64-${CI_COMMIT_TAG}","url":"${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/linux-x86_64/truite","type":"package"}'
# MAC_INTEL_ASSET_LINK: '{"name":"truite-apple-86_64-${CI_COMMIT_TAG}","url":"${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/apple-x86_64/truite","type":"package"}'
# MAC_ARM_ASSET_LINK: '{"name":"truite-apple-aarch64-${CI_COMMIT_TAG}","url":"${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/apple-aarch64/truite","type":"package"}'
DOCKER_ASSET_LINK
:
'
{"name":"truite:${CI_COMMIT_TAG}","url":"${CI_PROJECT_URL}/container_registry","type":"image"}'
script
:
-
echo "Releasing..."
-
echo "Tag = ${CI_COMMIT_TAG}"
-
echo "URL = ${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}"
-
echo "LINUX = ${LINUX_ASSET_LINK}"
# - echo "MAC INTEL = ${MAC_INTEL_ASSET_LINK}"
# - echo "MAC ARM = ${MAC_ARM_ASSET_LINK}"
-
echo "DOCKER = ${DOCKER_ASSET_LINK}"
-
|
release-cli --debug create --name "Release ${CI_COMMIT_TAG}" --tag-name "${CI_COMMIT_TAG}" --assets-link "${LINUX_ASSET_LINK}" --assets-link "${DOCKER_ASSET_LINK}"
-
echo "Done!"
needs
:
-
job
:
release-build-linux
artifacts
:
true
# - job: release-build-apple
# artifacts: true
-
job
:
release-docker
artifacts
:
true
rules
:
-
if
:
"
$CI_COMMIT_TAG
&&
$CI_COMMIT_TAG
=~
/^v/"
when
:
always
deploy-eco1
:
image
:
alpine:latest
...
...
@@ -142,3 +199,4 @@ deploy-eco1:
-
ssh $SSH_USER@$SSH_HOST "sudo docker pull $CI_REGISTRY_IMAGE && sudo docker-compose -f /opt/ecomobicoin/clermont/docker-compose.yml up -d --no-deps"
only
:
-
dev
when
:
manual
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment