Skip to content

Commit

Permalink
Testing release tag builid
Browse files Browse the repository at this point in the history
  • Loading branch information
jleaniz committed Sep 27, 2023
1 parent 24e517e commit 0730c26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
21 changes: 3 additions & 18 deletions docker/api_server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,10 @@ FROM ubuntu:22.04 as build-stage2
ENV DEBIAN_FRONTEND=noninteractive
COPY --from=build-stage /tmp/web/dist /web/dist
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install git python3-pip python3.10-venv
RUN apt-get -y install git python3-pip
RUN pip3 install pip --upgrade
RUN python3 -m venv /venv

COPY . /tmp/

# unshallow and fetch all tags so our build systems pickup the correct git tag if it's a shallow clone
RUN if $(cd /tmp/ && git rev-parse --is-shallow-repository); then cd /tmp/ && git fetch --prune --unshallow && git fetch --depth=1 origin +refs/tags/*:refs/tags/*; fi

# Build and install the package wheel using pip (will pull dependencies from pyproject.toml)
ENV PATH="/venv/bin:$PATH" VIRTUAL_ENV=/venv
RUN cd /tmp/ && pip3 install wheel && pip3 install .

# Final stage contains python and the virtualenv built in stage2
FROM ubuntu:22.04 as build-final

COPY --from=build-stage2 /venv /venv
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install python3-pip
ARG RELEASE_TAG
RUN pip3 install turbinia==$RELEASE_TAG
RUN useradd -r -s /bin/nologinpoet -u 999 turbinia
RUN mkdir /etc/turbinia && mkdir -p /mnt/turbinia/ && mkdir -p /var/lib/turbinia/ \
&& mkdir -p /var/log/turbinia/ && chown -R turbinia:turbinia /mnt/turbinia/ \
Expand Down
2 changes: 2 additions & 0 deletions docker/api_server/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ steps:
args:
[
"build",
'--build-arg',
'RELEASE_TAG=$TAG_NAME',
"-t",
"us-docker.pkg.dev/osdfir-registry/turbinia/release/turbinia-api-server:$TAG_NAME",
"-t",
Expand Down

0 comments on commit 0730c26

Please sign in to comment.