mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Merge pull request #5522 from juztin/develop
Builds both scratch & Alpine Docker images
This commit is contained in:
		
						commit
						d748165fb2
					
				| @ -22,6 +22,7 @@ Bugfixes: | |||||||
| 
 | 
 | ||||||
| Build System: | Build System: | ||||||
|  * Emscripten: Upgrade to Emscripten SDK 1.37.21 and boost 1.67. |  * Emscripten: Upgrade to Emscripten SDK 1.37.21 and boost 1.67. | ||||||
|  |  * Docker: Includes both Scratch and Alpine images. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								scripts/Dockerfile_alpine
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								scripts/Dockerfile_alpine
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | FROM alpine | ||||||
|  | MAINTAINER chriseth <chris@ethereum.org> | ||||||
|  | 
 | ||||||
|  | COPY upload/solc-static-linux /usr/local/bin/solc | ||||||
|  | ENTRYPOINT ["/usr/local/bin/solc"] | ||||||
| @ -2,7 +2,11 @@ | |||||||
| 
 | 
 | ||||||
| set -e | set -e | ||||||
| 
 | 
 | ||||||
|  | # Scratch image | ||||||
| docker build -t ethereum/solc:build -f scripts/Dockerfile . | docker build -t ethereum/solc:build -f scripts/Dockerfile . | ||||||
| tmp_container=$(docker create ethereum/solc:build sh) | tmp_container=$(docker create ethereum/solc:build sh) | ||||||
| mkdir -p upload | mkdir -p upload | ||||||
| docker cp ${tmp_container}:/usr/bin/solc upload/solc-static-linux | docker cp ${tmp_container}:/usr/bin/solc upload/solc-static-linux | ||||||
|  | 
 | ||||||
|  | # Alpine image | ||||||
|  | docker build -t ethereum/solc:build-alpine -f scripts/Dockerfile_alpine . | ||||||
|  | |||||||
| @ -2,20 +2,28 @@ | |||||||
| 
 | 
 | ||||||
| set -e | set -e | ||||||
| 
 | 
 | ||||||
|  | image="ethereum/solc" | ||||||
|  | 
 | ||||||
|  | tag_and_push() | ||||||
|  | { | ||||||
|  |     docker tag "$image:$1" "$image:$2" | ||||||
|  |     docker push "$image:$2" | ||||||
|  | } | ||||||
|  | 
 | ||||||
| docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; | docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; | ||||||
| version=$($(dirname "$0")/get_version.sh) | version=$($(dirname "$0")/get_version.sh) | ||||||
| if [ "$TRAVIS_BRANCH" = "develop" ] | if [ "$TRAVIS_BRANCH" = "develop" ] | ||||||
| then | then | ||||||
|     docker tag ethereum/solc:build ethereum/solc:nightly; |     tag_and_push build nightly | ||||||
|     docker tag ethereum/solc:build ethereum/solc:nightly-"$version"-"$TRAVIS_COMMIT" |     tag_and_push build nightly-"$version"-"$TRAVIS_COMMIT" | ||||||
|     docker push ethereum/solc:nightly-"$version"-"$TRAVIS_COMMIT"; |     tag_and_push build-alpine nightly-alpine | ||||||
|     docker push ethereum/solc:nightly; |     tag_and_push build-alpine nightly-alpine-"$version"-"$TRAVIS_COMMIT" | ||||||
| elif [ "$TRAVIS_TAG" = v"$version" ] | elif [ "$TRAVIS_TAG" = v"$version" ] | ||||||
| then | then | ||||||
|     docker tag ethereum/solc:build ethereum/solc:stable; |     tag_and_push build stable | ||||||
|     docker tag ethereum/solc:build ethereum/solc:"$version"; |     tag_and_push build "$version" | ||||||
|     docker push ethereum/solc:stable; |     tag_and_push build-alpine stable-alpine | ||||||
|     docker push ethereum/solc:"$version"; |     tag_and_push build-alpine "$version"-alpine | ||||||
| else | else | ||||||
|     echo "Not publishing docker image from branch $TRAVIS_BRANCH or tag $TRAVIS_TAG" |     echo "Not publishing docker image from branch $TRAVIS_BRANCH or tag $TRAVIS_TAG" | ||||||
| fi | fi | ||||||
|  | |||||||
| @ -7,6 +7,7 @@ then | |||||||
|     echo "Usage: $0 <tag/branch>" |     echo "Usage: $0 <tag/branch>" | ||||||
|     exit 1 |     exit 1 | ||||||
| fi | fi | ||||||
|  | image="ethereum/solc" | ||||||
| branch="$1" | branch="$1" | ||||||
| 
 | 
 | ||||||
| #docker login | #docker login | ||||||
| @ -27,21 +28,27 @@ else | |||||||
|     date -u +"nightly.%Y.%-m.%-d" > prerelease.txt |     date -u +"nightly.%Y.%-m.%-d" > prerelease.txt | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | tag_and_push() | ||||||
|  | { | ||||||
|  |     docker tag "$image:$1" "$image:$2" | ||||||
|  |     docker push "$image:$2" | ||||||
|  | } | ||||||
|  | 
 | ||||||
| rm -rf .git | rm -rf .git | ||||||
| docker build -t ethereum/solc:build -f scripts/Dockerfile . | docker build -t "$image":build -f scripts/Dockerfile . | ||||||
| tmp_container=$(docker create ethereum/solc:build sh) | tmp_container=$(docker create "$image":build sh) | ||||||
| if [ "$branch" = "develop" ] | if [ "$branch" = "develop" ] | ||||||
| then | then | ||||||
|     docker tag ethereum/solc:build ethereum/solc:nightly; |     tag_and_push build nightly | ||||||
|     docker tag ethereum/solc:build ethereum/solc:nightly-"$version"-"$commithash" |     tag_and_push build nightly-"$version"-"$commithash" | ||||||
|     docker push ethereum/solc:nightly-"$version"-"$commithash"; |     tag_and_push build-alpine nightly-alpine | ||||||
|     docker push ethereum/solc:nightly; |     tag_and_push build-alpine nightly-alpine-"$version"-"$commithash" | ||||||
| elif [ "$branch" = v"$version" ] | elif [ "$branch" = v"$version" ] | ||||||
| then | then | ||||||
|     docker tag ethereum/solc:build ethereum/solc:stable; |     tag_and_push build stable | ||||||
|     docker tag ethereum/solc:build ethereum/solc:"$version"; |     tag_and_push build "$version" | ||||||
|     docker push ethereum/solc:stable; |     tag_and_push build-alpine stable-alpine | ||||||
|     docker push ethereum/solc:"$version"; |     tag_and_push build-alpine "$version"-alpine | ||||||
| else | else | ||||||
|     echo "Not publishing docker image from branch or tag $branch" |     echo "Not publishing docker image from branch or tag $branch" | ||||||
| fi | fi | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user