Skip to content

Commit

Permalink
Merge pull request #15389 from ethereum/ci-job-testing-docker-build
Browse files Browse the repository at this point in the history
`b_alpine_docker` CI run
  • Loading branch information
cameel authored Sep 9, 2024
2 parents 09e9aa6 + 32b8b41 commit 40758c3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
19 changes: 19 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,22 @@ jobs:
- matrix_notify_failure_unless_pr
- matrix_notify_release_unless_pr

b_alpine_docker:
<<: *base_cimg_small
steps:
- setup_remote_docker:
# Always build from scratch to use current packages.
# This job is only meant to run nightly so build time is not an issue.
docker_layer_caching: false
- checkout
- run:
name: Build and tag the container
command: scripts/docker_deploy_manual.sh develop "file://$PWD" --no-push
- run:
name: Smoke test
command: docker run --pull=never ethereum/solc:build-alpine --version
- matrix_notify_failure_unless_pr

workflows:
version: 2

Expand Down Expand Up @@ -2009,6 +2025,9 @@ workflows:
- b_ubu: *requires_nothing
- t_ubu_soltest_deprecated_evm_versions: *requires_b_ubu

# Build in a Docker container (on Alpine Linux)
- b_alpine_docker: *requires_nothing

nightly-ossfuzz:

triggers:
Expand Down
32 changes: 22 additions & 10 deletions scripts/docker_deploy_manual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,38 @@

set -e

if [ -z "$1" ]
then
echo "Usage: $0 <tag/branch>"
exit 1
fi
REPO_ROOT="$(dirname "$0")/.."
# shellcheck source=scripts/common.sh
source "${REPO_ROOT}/scripts/common.sh"

image="ethereum/solc"

if (( $# < 1 || $# > 3 )); then
fail "Usage: $0 <tag/branch> [repo URL] [--no-push]"
fi

branch="$1"
repo_url="${2:-https://github.com/ethereum/solidity.git}"

if (( $# >= 3 )); then
[[ $3 == --no-push ]] || fail "Invalid flag: $3. Expected --no-push."
publish=false
else
publish=true
fi

#docker login

DIR=$(mktemp -d)
(
cd "$DIR"

git clone --recursive --depth 2 https://github.com/ethereum/solidity.git -b "$branch"
git clone --recursive --depth 2 "$repo_url" -b "$branch" solidity
cd solidity
commithash=$(git rev-parse --short=8 HEAD)
echo -n "$commithash" > commit_hash.txt
version=$("$(dirname "$0")/get_version.sh")
if [ "$branch" = "release" ] || [ "$branch" = v"$version" ]
if [ "$branch" = v"$version" ]
then
echo -n > prerelease.txt
else
Expand All @@ -31,17 +43,17 @@ fi
function tag_and_push
{
docker tag "$image:$1" "$image:$2"
docker push "$image:$2"
[[ $publish == false ]] || docker push "$image:$2"
}

rm -rf .git
docker build -t "$image":build -f scripts/Dockerfile .
docker build -t "$image":build -f scripts/Dockerfile . --progress plain
tmp_container=$(docker create "$image":build sh)

# Alpine image
mkdir -p upload
docker cp "${tmp_container}":/usr/bin/solc upload/solc-static-linux
docker build -t "$image":build-alpine -f scripts/Dockerfile_alpine .
docker build -t "$image":build-alpine -f scripts/Dockerfile_alpine . --progress plain

if [ "$branch" = "develop" ]
then
Expand Down
2 changes: 1 addition & 1 deletion scripts/release_ppa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
## You can pass a branch name as argument to this script (which, if no argument is given,
## will default to "develop").
##
## If the given branch is "release", the resulting package will be uploaded to
## If the given branch matches a release version tag, the resulting package will be uploaded to
## ethereum/ethereum PPA, or ethereum/ethereum-dev PPA otherwise.
##
## It will clone the Solidity git from github, determine the version,
Expand Down

0 comments on commit 40758c3

Please sign in to comment.