3
0

Remove cache from the build pipeline

This commit is contained in:
Denis Arh 2021-11-05 08:57:40 +01:00
parent 032566d902
commit b03aa7b721
3 changed files with 19 additions and 31 deletions

View File

@ -3,3 +3,4 @@
build
codegen
var
webapp

View File

@ -40,12 +40,6 @@ jobs:
- uses: actions/setup-go@v1
with:
go-version: 1.16
- uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: make release-clean release
- run: make upload
if: ${{ !env.ACT }}
@ -91,7 +85,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: docker build -t cortezaproject/corteza-server:${{ env.BUILD_VERSION }} .
- run: docker build --build-arg "BUILD_VERSION=${BUILD_VERSION}" -t cortezaproject/corteza-server:${{ env.BUILD_VERSION }} .
if: ${{ !env.ACT }}
- run: docker push cortezaproject/corteza-server:${{ env.BUILD_VERSION }}
if: ${{ !env.ACT }}

View File

@ -1,18 +1,3 @@
# build stage
FROM golang:1.16-buster as build-stage
ENV GOFLAGS='-mod=readonly'
ENV BUILD_OS=linux
ENV BUILD_ARCH=amd64
ENV BUILD_VERSION=latest
WORKDIR /corteza
COPY . ./
RUN make release-clean release
# deploy stage
FROM ubuntu:20.04
@ -22,21 +7,29 @@ RUN apt-get -y update \
curl \
&& rm -rf /var/lib/apt/lists/*
ARG VERSION=2021.9.0
ARG SERVER_VERSION=${VERSION}
ARG CORTEZA_SERVER_PATH=https://releases.cortezaproject.org/files/corteza-server-${SERVER_VERSION}-linux-amd64.tar.gz
RUN mkdir /tmp/server
ADD $CORTEZA_SERVER_PATH /tmp/server
VOLUME /data
RUN tar -zxvf "/tmp/server/$(basename $CORTEZA_SERVER_PATH)" -C / && \
rm -rf "/tmp/server" && \
mv /corteza-server /corteza
WORKDIR /corteza
HEALTHCHECK --interval=30s --start-period=1m --timeout=30s --retries=3 \
CMD curl --silent --fail --fail-early http://127.0.0.1:80/healthcheck || exit 1
ENV STORAGE_PATH "/data"
ENV CORREDOR_ADDR "corredor:80"
ENV HTTP_ADDR "0.0.0.0:80"
ENV HTTP_WEBAPP_ENABLED "false"
ENV PATH "/corteza/bin:${PATH}"
WORKDIR /corteza
VOLUME /data
COPY --from=build-stage /corteza/build/pkg/corteza-server ./
HEALTHCHECK --interval=30s --start-period=1m --timeout=30s --retries=3 \
CMD curl --silent --fail --fail-early http://127.0.0.1:80/healthcheck || exit 1
EXPOSE 80
ENTRYPOINT ["./bin/corteza-server"]