Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
doc
target
89 changes: 89 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
stages:
- test
- build

image: parity/rust:gitlab-ci

variables:
CI_SERVER_NAME: "GitLab CI"
CARGO_HOME: "${CI_PROJECT_DIR}/cargo"

BUILD_TARGET: ubuntu
BUILD_ARCH: amd64
CARGO_TARGET: x86_64-unknown-linux-gnu

cache:
key: "${CI_JOB_NAME}"
policy: pull
paths:
- ${CI_PROJECT_DIR}/target/
- ${CI_PROJECT_DIR}/cargo/

.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
only: &releaseable_branches
- master
- stable
- beta
- tags
- gitlab-next

.publishable_branches: # list of git refs for publishing builds to the "production" locations
only: &publishable_branches
- nightly # Our nightly builds from schedule, on `master`
- "v*" # Our version tags
- gitlab-next

.collect_artifacts: &collect_artifacts
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 1 mos
paths:
- target/release/polkadot

.determine_version: &determine_version |
export VERSION=$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
echo "Version" $VERSION


#### stage: test

test:rust:stable: &test
stage: test
variables:
RUST_TOOLCHAIN: stable
TARGET: native
script:
- ./scripts/init.sh
- export PATH="${CI_PROJECT_DIR}/cargo/bin/:$PATH"
- ./scripts/build.sh
- ./scripts/build-demos.sh
- time cargo test --all --release
tags:
- rust-stable

.optional_test: &optional_test
<<: *test
allow_failure: true
only:
- master

#### stage: build

build:linux:ubuntu:amd64: &build
stage: build
only: *releaseable_branches
variables:
CARGO_TARGET: x86_64-unknown-linux-gnu
TARGET: native
RUST_TOOLCHAIN: stable
script:
- ./scripts/init.sh
- export PATH="${CI_PROJECT_DIR}/cargo/bin/:$PATH"
- ./scripts/build.sh
- ./scripts/build-demos.sh
- cargo build --release
<<: *collect_artifacts
tags:
- rust-stable
allow_failure: true
135 changes: 67 additions & 68 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Then build the code:

[source, shell]
----
./build.sh # Builds the WebAssembly binaries
./scripts/build.sh # Builds the WebAssembly binaries
cargo build # Builds all native code
----

Expand All @@ -118,7 +118,7 @@ The easiest/faster option is to use the latest image.
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:

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


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

[source, shell]
----
ccd docker
./build.sh
./docker/build.sh
----

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

[source, shell]
docker run --rm -it chevdor/polkadot:latest version
docker run --rm -it chevdor/polkadot:latest polkadot --version

This will show you the polkadot version as well as the git commit ref that was used to build your container.
Just paste that in the issue you create.
Expand Down
5 changes: 3 additions & 2 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ case $TARGET in

"wasm")
# Install prerequisites and build all wasm projects
./init.sh
./build.sh
./scripts/init.sh
./scripts/build.sh
./scripts/build-demos.sh
;;
esac
68 changes: 34 additions & 34 deletions demo/runtime/wasm/Cargo.lock

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
33 changes: 0 additions & 33 deletions docker/Dockerfile

This file was deleted.

18 changes: 13 additions & 5 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
#!/usr/bin/env bash
set -e

pushd .

# The following line ensure we run from the project root
PROJECT_ROOT=`git rev-parse --show-toplevel`
cd $PROJECT_ROOT

# Find the current version from Cargo.toml
VERSION=`grep "^version" ../Cargo.toml | egrep -o "([0-9\.]+)"`
VERSION=`grep "^version" ./Cargo.toml | egrep -o "([0-9\.]+)"`
GITUSER=chevdor
GITREPO=polkadot

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

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

echo -e "\nIf you just built the latest, you may want to update your tag:"
echo " $ docker tag ${GITUSER}/${GITREPO}:$VERSION ${GITUSER}/${GITREPO}:latest"
echo -e "\nIf you just built version ${VERSION}, you may want to update your tag:"
echo " $ docker tag ${GITUSER}/${GITREPO}:$VERSION ${GITUSER}/${GITREPO}:${VERSION}"

popd
8 changes: 0 additions & 8 deletions docker/cleanup.sh

This file was deleted.

4 changes: 2 additions & 2 deletions docker/readme-docker.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

Run the following command

docker run -d chevdor/polkadot:latest polkadot
docker run -d -P --name polkadot chevdor/polkadot:latest

=== Building the image

To build your own image from the source, you can run the following command:

./build.sh
./docker/build.sh

NOTE: Building the image takes a while. Count at least 30min on a good machine.
13 changes: 0 additions & 13 deletions docker/version

This file was deleted.

Loading