Add capabilities of building grpc CI image from different branches
This commit is contained in:
		
							parent
							
								
									7dcf727782
								
							
						
					
					
						commit
						a0453f1262
					
				
							
								
								
									
										10
									
								
								.github/workflows/build_and_push_ci_image.yml
									
									
									
									
										vendored
									
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										10
									
								
								.github/workflows/build_and_push_ci_image.yml
									
									
									
									
										vendored
									
									
								
							| @ -32,11 +32,17 @@ jobs: | ||||
|     - name: Get occlum version | ||||
|       run: echo "OCCLUM_VERSION=$(grep 'Version =' src/pal/include/occlum_version.h | awk '{print $4}')" >> $GITHUB_ENV; | ||||
| 
 | ||||
|     - name: Get branch name | ||||
|       # GITHUB_REF=refs/heads/branch-name | ||||
|       # ${GITHUB_REF##*/} == branch-name | ||||
|       run: echo "OCCLUM_BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV; | ||||
| 
 | ||||
|     # Because "Build and push" step `context` field can't be subdir, | ||||
|     # we need to copy files needed by dockerfile to root dir of the project | ||||
|     - name: Copy context for docker build | ||||
|       run: | | ||||
|         cp -r tools/docker . | ||||
| 
 | ||||
|     - name: Set up QEMU | ||||
|       uses: docker/setup-qemu-action@v1 | ||||
| 
 | ||||
| @ -55,7 +61,9 @@ jobs: | ||||
|         context: . | ||||
|         file: ./tools/docker/ci/Dockerfile.grpc | ||||
|         platforms: linux/amd64 | ||||
|         build-args: OCCLUM_VERSION=${{ env.OCCLUM_VERSION }} | ||||
|         build-args: | | ||||
|           "OCCLUM_VERSION=${{ env.OCCLUM_VERSION }}" | ||||
|           "OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }}" | ||||
|         push: true | ||||
|         tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu18.04-grpc | ||||
| 
 | ||||
|  | ||||
| @ -2,9 +2,10 @@ ARG OCCLUM_VERSION | ||||
| FROM occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 as base | ||||
| LABEL maintainer="Chunyang Hui <sanqian.hcy@antgroup.com>" | ||||
| 
 | ||||
| ARG OCCLUM_BRANCH | ||||
| WORKDIR /root | ||||
| RUN rm -rf /root/demos && \ | ||||
|     git clone https://github.com/occlum/occlum.git && \ | ||||
|     git clone -b $OCCLUM_BRANCH https://github.com/occlum/occlum.git && \ | ||||
|     cp -r occlum/demos /root/demos && \ | ||||
|     rm -rf /root/occlum | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user