Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
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
nodes
rust
Duniter v2S
Commits
0faf05f5
Commit
0faf05f5
authored
3 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
ci: deploy a docker debug image a each master commit
parent
869fe88b
No related branches found
No related tags found
1 merge request
!16
ci: deploy a docker debug image a each master commit
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+79
-5
79 additions, 5 deletions
.gitlab-ci.yml
docker/duniter-debug.Dockerfile
+36
-0
36 additions, 0 deletions
docker/duniter-debug.Dockerfile
integration-tests/tests/common/mod.rs
+4
-1
4 additions, 1 deletion
integration-tests/tests/common/mod.rs
with
119 additions
and
6 deletions
.gitlab-ci.yml
+
79
−
5
View file @
0faf05f5
stages
:
-
quality
-
build
-
tests
#
-
build
-
deploy
workflow
:
rules
:
...
...
@@ -21,7 +22,7 @@ workflow:
fmt_and_clippy
:
extends
:
.env
rules
:
-
if
:
$CI_COMMIT_TAG
-
if
:
'
$CI_COMMIT_TAG
||
$CI_COMMIT_BRANCH
==
"master"'
when
:
never
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
when
:
manual
...
...
@@ -32,18 +33,91 @@ fmt_and_clippy:
-
cargo clippy -- -V
-
cargo clippy --all --tests -- -D warnings
tests
:
build_debug
:
extends
:
.env
rules
:
-
if
:
$CI_COMMIT_TAG
when
:
never
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"
||
$CI_COMMIT_BRANCH
==
"master"'
-
when
:
manual
stage
:
build
script
:
-
cargo build
-
mkdir build
-
mv target/debug/duniter build/duniter
artifacts
:
paths
:
-
build/
build_release
:
extends
:
.env
rules
:
-
if
:
'
$CI_COMMIT_TAG
||
$CI_COMMIT_BRANCH
=~
/^release/'
-
when
:
never
stage
:
build
script
:
-
cargo build --release
-
mkdir build
-
mv target/release/duniter build/duniter
artifacts
:
paths
:
-
build/
expire_in
:
1 day
tests_debug
:
extends
:
.env
rules
:
-
if
:
$CI_COMMIT_REF_NAME =~ /^wip*$/
when
:
manual
-
if
:
$CI_COMMIT_TAG
when
:
never
-
if
:
'
$CI_MERGE_REQUEST_ID
||$CI_COMMIT_BRANCH
==
"master"
||
$CI_COMMIT_BRANCH
=~
/^release/
'
-
if
:
'
$CI_MERGE_REQUEST_ID
||
$CI_COMMIT_BRANCH
==
"master"'
-
when
:
manual
stage
:
tests
variables
:
DUNITER_BINARY_PATH
:
"
../build/duniter"
DUNITER_INTEGRATION_TESTS_SPAWN_NODE_DURATION
:
"
20"
script
:
-
cargo test
dependencies
:
-
build_debug
tests_release
:
extends
:
.env
rules
:
-
if
:
'
$CI_COMMIT_TAG
||
$CI_COMMIT_BRANCH
=~
/^release/'
-
when
:
never
stage
:
tests
variables
:
DUNITER_BINARY_PATH
:
"
../build/duniter"
DUNITER_INTEGRATION_TESTS_SPAWN_NODE_DURATION
:
"
10"
script
:
-
cargo build
-
cargo test
dependencies
:
-
build_release
.docker-build-app-image
:
stage
:
deploy
image
:
docker:18.06
tags
:
-
redshift
services
:
-
docker:18.06-dind
before_script
:
-
docker info
script
:
-
docker pull $CI_REGISTRY_IMAGE:$IMAGE_TAG ||
true
-
docker build --cache-from $CI_REGISTRY_IMAGE:$IMAGE_TAG --pull -t "$CI_REGISTRY_IMAGE:$IMAGE_TAG" -f $DOCKERFILE_PATH .
-
docker login -u "duniterteam" -p "$DUNITERTEAM_PASSWD"
-
docker tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "duniter/duniter-v2s:$IMAGE_TAG"
-
docker push "duniter/duniter-v2s:$IMAGE_TAG"
deploy_docker_debug
:
extends
:
.docker-build-app-image
rules
:
-
if
:
$CI_COMMIT_TAG
when
:
never
-
if
:
$CI_COMMIT_BRANCH == "master"
variables
:
DOCKERFILE_PATH
:
"
docker/duniter-debug.Dockerfile"
IMAGE_TAG
:
"
debug-sha-$CI_COMMIT_SHORT_SHA"
This diff is collapsed.
Click to expand it.
docker/duniter-debug.Dockerfile
0 → 100644
+
36
−
0
View file @
0faf05f5
# Duniter debug node
#
# Requires to run from repository root and to copy the binary in the build folder
# (part of the CI workflow)
FROM
docker.io/library/ubuntu:20.04
AS
builder
RUN
apt-get update
&&
apt-get
install
-y
ca-certificates
&&
update-ca-certificates
FROM
debian:buster-slim
LABEL
maintainer "elois@duniter.org"
LABEL
description="Binary for duniter debug node"
RUN
useradd
-m
-u
1000
-U
-s
/bin/sh
-d
/duniter duniter
&&
\
mkdir
-p
/duniter/.local/share
&&
\
mkdir
/data
&&
\
chown
-R
duniter:duniter /data
&&
\
ln
-s
/data /duniter/.local/share/duniter
&&
\
rm
-rf
/usr/bin /usr/sbin
COPY
--from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
USER
duniter
COPY
--chown=duniter build/duniter /duniter/duniter
RUN
chmod
uog+x /duniter/duniter
# 30333 for p2p
# 9933 for RPC call
# 9944 for Websocket
# 9615 for Prometheus (metrics)
EXPOSE
30333 9933 9944 9615
VOLUME
["/data"]
ENTRYPOINT
["/duniter/duniter"]
This diff is collapsed.
Click to expand it.
integration-tests/tests/common/mod.rs
+
4
−
1
View file @
0faf05f5
...
...
@@ -41,11 +41,14 @@ impl Drop for Process {
}
pub
async
fn
spawn_node
()
->
(
Api
,
Client
,
Process
)
{
let
duniter_binary_path
=
std
::
env
::
var
(
"DUNITER_BINARY_PATH"
)
.unwrap_or_else
(|
_
|
"../target/debug/duniter"
.to_owned
());
let
p2p_port
=
portpicker
::
pick_unused_port
()
.expect
(
"No ports free"
);
let
rpc_port
=
portpicker
::
pick_unused_port
()
.expect
(
"No ports free"
);
let
ws_port
=
portpicker
::
pick_unused_port
()
.expect
(
"No ports free"
);
let
process
=
Process
(
Command
::
new
(
"../target/debug/duniter"
)
Command
::
new
(
duniter_binary_path
)
.args
([
"--execution=Native"
,
"--no-telemetry"
,
...
...
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