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

Fix build script for the builder image #5189

Merged
merged 1 commit into from
Mar 28, 2022
Merged
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
11 changes: 7 additions & 4 deletions scripts/dockerfiles/polkadot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ PROJECT_ROOT=`git rev-parse --show-toplevel`
cd $PROJECT_ROOT

# Find the current version from Cargo.toml
VERSION=`grep "^version" ./cli/Cargo.toml | egrep -o "([0-9\.]+)"`
VERSION=`grep "^version" ./cli/Cargo.toml | egrep -o "([0-9\.]+-?[0-9]+)"`
Copy link
Contributor

@coderobe coderobe Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would do something like this instead:

Suggested change
VERSION=`grep "^version" ./cli/Cargo.toml | egrep -o "([0-9\.]+-?[0-9]+)"`
VERSION=`grep "^version" ./cli/Cargo.toml | egrep -o "([0-9\.\-]+)"`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why that ? Do you expect some 0.9-1.13 versions or something looking like that ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♀️ Not necessarily, but shorter regexes are nicer for maintainability IMO.
Fine with either, really

GITUSER=parity
GITREPO=polkadot

# Build the image
echo "Building ${GITUSER}/${GITREPO}:latest docker image, hang on!"
time docker build -f ./scripts/dockerfiles/polkadot/polkadot_builder.Dockerfile -t ${GITUSER}/${GITREPO}:latest .
docker tag ${GITUSER}/${GITREPO}:latest ${GITUSER}/${GITREPO}:v${VERSION}
time docker build \
-f ./scripts/dockerfiles/polkadot/polkadot_builder.Dockerfile \
-t ${GITUSER}/${GITREPO}:latest \
-t ${GITUSER}/${GITREPO}:v${VERSION} \
.

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

popd