Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit b6d7182

Browse files
dvdplmgavofyork
authored andcommitted
Use parity-ethereum rev 02c54d42398f to fix build (#655)
* Use parity-ethereum rev 02c54d42398f to fix build * More lockfiles and new build artifacts * Update .gitlab-ci.yml (#633) it is necessary to test. You will probably have to create a cron-job for the nightly assembly of the master branch * Do not attempt to rustup if in CI. This is taken care of by the base (#621) image. * Improve docker image size with a 2 stages image (#463) * Improve docker image size with a 2 stages image * Minor doc updates * Fix and reduce size of the docker image * Fix paths in scripts * cargo --force to allow CI to build. (#599)
1 parent 6dc319a commit b6d7182

File tree

32 files changed

+344
-268
lines changed

32 files changed

+344
-268
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
doc
12
target

.gitlab-ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
stages:
2+
- test
3+
- build
4+
5+
image: parity/rust:gitlab-ci
6+
7+
variables:
8+
CI_SERVER_NAME: "GitLab CI"
9+
CARGO_HOME: "${CI_PROJECT_DIR}/cargo"
10+
11+
BUILD_TARGET: ubuntu
12+
BUILD_ARCH: amd64
13+
CARGO_TARGET: x86_64-unknown-linux-gnu
14+
15+
cache:
16+
key: "${CI_JOB_NAME}"
17+
policy: pull
18+
paths:
19+
- ${CI_PROJECT_DIR}/target/
20+
- ${CI_PROJECT_DIR}/cargo/
21+
22+
.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
23+
only: &releaseable_branches
24+
- master
25+
- stable
26+
- beta
27+
- tags
28+
- gitlab-next
29+
30+
.publishable_branches: # list of git refs for publishing builds to the "production" locations
31+
only: &publishable_branches
32+
- nightly # Our nightly builds from schedule, on `master`
33+
- "v*" # Our version tags
34+
- gitlab-next
35+
36+
.collect_artifacts: &collect_artifacts
37+
artifacts:
38+
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
39+
when: on_success
40+
expire_in: 1 mos
41+
paths:
42+
- target/release/polkadot
43+
44+
.determine_version: &determine_version |
45+
export VERSION=$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
46+
echo "Version" $VERSION
47+
48+
49+
#### stage: test
50+
51+
test:rust:stable: &test
52+
stage: test
53+
variables:
54+
RUST_TOOLCHAIN: stable
55+
TARGET: native
56+
script:
57+
- ./scripts/init.sh
58+
- export PATH="${CI_PROJECT_DIR}/cargo/bin/:$PATH"
59+
- ./scripts/build.sh
60+
- ./scripts/build-demos.sh
61+
- time cargo test --all --release
62+
tags:
63+
- rust-stable
64+
65+
.optional_test: &optional_test
66+
<<: *test
67+
allow_failure: true
68+
only:
69+
- master
70+
71+
#### stage: build
72+
73+
build:linux:ubuntu:amd64: &build
74+
stage: build
75+
only: *releaseable_branches
76+
variables:
77+
CARGO_TARGET: x86_64-unknown-linux-gnu
78+
TARGET: native
79+
RUST_TOOLCHAIN: stable
80+
script:
81+
- ./scripts/init.sh
82+
- export PATH="${CI_PROJECT_DIR}/cargo/bin/:$PATH"
83+
- ./scripts/build.sh
84+
- ./scripts/build-demos.sh
85+
- cargo build --release
86+
<<: *collect_artifacts
87+
tags:
88+
- rust-stable
89+
allow_failure: true

Cargo.lock

Lines changed: 67 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.adoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Then build the code:
9292

9393
[source, shell]
9494
----
95-
./build.sh # Builds the WebAssembly binaries
95+
./scripts/build.sh # Builds the WebAssembly binaries
9696
cargo build # Builds all native code
9797
----
9898

@@ -118,7 +118,7 @@ The easiest/faster option is to use the latest image.
118118
Let´s first check the version we have. The first time you run this command, the polkadot docker image will be downloaded. This takes a bit of time and bandwidth, be patient:
119119

120120
[source, shell]
121-
docker run --rm -it chevdor/polkadot:latest ./version
121+
docker run --rm -it chevdor/polkadot:latest pokadot --version
122122

123123

124124
.Polkadot arguments
@@ -149,8 +149,7 @@ You can either build it yourself (it takes a while...):
149149

150150
[source, shell]
151151
----
152-
ccd docker
153-
./build.sh
152+
./docker/build.sh
154153
----
155154

156155
=== Reporting issues
@@ -159,7 +158,7 @@ If you run into issues with polkadot when using docker, please run the following
159158
(replace the tag with the appropriate one if you do not use latest):
160159

161160
[source, shell]
162-
docker run --rm -it chevdor/polkadot:latest version
161+
docker run --rm -it chevdor/polkadot:latest polkadot --version
163162

164163
This will show you the polkadot version as well as the git commit ref that was used to build your container.
165164
Just paste that in the issue you create.

ci/script.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ case $TARGET in
2222

2323
"wasm")
2424
# Install prerequisites and build all wasm projects
25-
./init.sh
26-
./build.sh
25+
./scripts/init.sh
26+
./scripts/build.sh
27+
./scripts/build-demos.sh
2728
;;
2829
esac

demo/runtime/wasm/Cargo.lock

Lines changed: 34 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.

docker/Dockerfile

Lines changed: 0 additions & 33 deletions
This file was deleted.

docker/build.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
#!/usr/bin/env bash
22
set -e
33

4+
pushd .
5+
6+
# The following line ensure we run from the project root
7+
PROJECT_ROOT=`git rev-parse --show-toplevel`
8+
cd $PROJECT_ROOT
9+
410
# Find the current version from Cargo.toml
5-
VERSION=`grep "^version" ../Cargo.toml | egrep -o "([0-9\.]+)"`
11+
VERSION=`grep "^version" ./Cargo.toml | egrep -o "([0-9\.]+)"`
612
GITUSER=chevdor
713
GITREPO=polkadot
814

915
# Build the image
10-
echo "Building ${GITREPO}:$VERSION docker image, hang on!"
11-
time docker build --build-arg PROFILE=release -t ${GITUSER}/${GITREPO}:$VERSION .
16+
echo "Building ${GITUSER}/${GITREPO}:latest docker image, hang on!"
17+
time docker build -f ./docker/Dockerfile --build-arg PROFILE=release -t ${GITUSER}/${GITREPO}:latest .
1218

1319
# Show the list of available images for this repo
1420
echo "Image is ready"
1521
docker images | grep ${GITREPO}
1622

17-
echo -e "\nIf you just built the latest, you may want to update your tag:"
18-
echo " $ docker tag ${GITUSER}/${GITREPO}:$VERSION ${GITUSER}/${GITREPO}:latest"
23+
echo -e "\nIf you just built version ${VERSION}, you may want to update your tag:"
24+
echo " $ docker tag ${GITUSER}/${GITREPO}:$VERSION ${GITUSER}/${GITREPO}:${VERSION}"
25+
26+
popd

0 commit comments

Comments
 (0)