mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-11 15:39:33 -05:00
fix build coordinator workflow (#190)
Co-authored-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
fd3008f5cc
commit
430ab6ab1f
38
.github/workflows/build-coordinator.yml
vendored
38
.github/workflows/build-coordinator.yml
vendored
@ -23,38 +23,17 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Install Dependencies
|
||||
id: prepare
|
||||
run: sudo apt-get update && sudo apt-get -y install awscli
|
||||
run: sudo apt-get update && sudo apt-get -y install awscli cmake make
|
||||
|
||||
- name: Build the Coordinator
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.build
|
||||
outputs: .
|
||||
push: false
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||
target: coordinator-hashed
|
||||
|
||||
# This ugly bit is necessary if you don't want your cache to grow forever
|
||||
# till it hits GitHub's limit of 5GB.
|
||||
# Temp fix
|
||||
# https://github.com/docker/build-push-action/issues/252
|
||||
# https://github.com/moby/buildkit/issues/1896
|
||||
- name: Move cache
|
||||
- name: Build and tag the Coordinator
|
||||
id: build
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make coordinator
|
||||
mv coordinator coordinator-$(sha512sum coordinator | cut -d " " -f 1)
|
||||
|
||||
- name: Copy Coordinator to S3 if not exists
|
||||
id: copy
|
||||
@ -62,8 +41,9 @@ jobs:
|
||||
aws s3api head-object --bucket ${{ secrets.PUBLIC_BUCKET_NAME }} --key coordinator/$(ls | grep "coordinator-")
|
||||
|| (
|
||||
echo "::set-output name=coordinator-name::$(ls | grep "coordinator-")"
|
||||
&& aws s3 cp ${{ github.workspace }}/ s3://${{ secrets.PUBLIC_BUCKET_NAME }}/coordinator/ --exclude "*" --include "coordinator-*" --include "constellation" --recursive --quiet)
|
||||
&& aws s3 cp ${{ github.workspace }}/build/ s3://${{ secrets.PUBLIC_BUCKET_NAME }}/coordinator/ --exclude "*" --include "coordinator-*" --include "constellation" --recursive --quiet)
|
||||
shell: bash {0}
|
||||
working-directory: ${{ github.workspace }}/build/
|
||||
|
||||
call-coreos:
|
||||
needs: build-coordinator
|
||||
|
@ -27,9 +27,6 @@ WORKDIR /constellation/coordinator/
|
||||
ARG PROJECT_VERSION
|
||||
RUN go build -o coordinator -tags=gcp,disable_tpm_simulator -buildvcs=false -ldflags "-s -w -buildid='' -X main.version=${PROJECT_VERSION}" ./cmd/coordinator/
|
||||
|
||||
FROM build-coordinator AS hash-coordinator
|
||||
RUN mv coordinator coordinator-$(sha512sum coordinator | cut -d " " -f 1)
|
||||
|
||||
FROM build AS build-disk-mapper
|
||||
WORKDIR /constellation/state/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user