Mohammed Naser | 1220717 | 2024-02-05 18:49:35 -0500 | [diff] [blame] | 1 | VERSION --use-copy-link --try 0.8 |
| 2 | |
Mohammed Naser | 1220717 | 2024-02-05 18:49:35 -0500 | [diff] [blame] | 3 | unit.go: |
| 4 | FROM golang:1.21 |
| 5 | RUN go install github.com/jstemmer/go-junit-report/v2@latest |
| 6 | COPY --dir go.mod go.sum /src |
| 7 | WORKDIR /src |
| 8 | RUN go mod download |
| 9 | COPY --dir charts/ cmd/ internal/ roles/ tools/ /src |
| 10 | TRY |
| 11 | RUN go test -v 2>&1 ./... | go-junit-report -set-exit-code > junit-go.xml |
| 12 | FINALLY |
| 13 | SAVE ARTIFACT /src/junit-go.xml AS LOCAL junit-go.xml |
| 14 | END |
| 15 | |
vexxhost-bot | 134680a | 2024-07-19 04:30:48 +0200 | [diff] [blame] | 16 | build.venv.runtime: |
Mohammed Naser | da99423 | 2024-04-13 12:34:01 -0400 | [diff] [blame] | 17 | FROM ubuntu:jammy |
vexxhost-bot | 134680a | 2024-07-19 04:30:48 +0200 | [diff] [blame] | 18 | RUN \ |
| 19 | apt-get update -qq |
Mohammed Naser | da99423 | 2024-04-13 12:34:01 -0400 | [diff] [blame] | 20 | RUN \ |
| 21 | apt-get install -qq -y --no-install-recommends \ |
| 22 | build-essential git python3-dev python3-pip python3-venv |
vexxhost-bot | 134680a | 2024-07-19 04:30:48 +0200 | [diff] [blame] | 23 | COPY requirements.txt ./ |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 24 | RUN python3 -m venv /venv |
| 25 | ENV PATH=/venv/bin:$PATH |
| 26 | RUN pip install -r requirements.txt |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame] | 27 | SAVE ARTIFACT /venv |
| 28 | |
| 29 | build.collections: |
| 30 | FROM +build.venv.runtime |
| 31 | COPY charts /src/charts |
| 32 | COPY meta /src/meta |
| 33 | COPY playbooks /src/playbooks |
| 34 | COPY plugins /src/plugins |
| 35 | COPY roles /src/roles |
| 36 | COPY galaxy.yml /src/galaxy.yml |
| 37 | RUN ansible-galaxy collection install --collections-path /usr/share/ansible/collections /src |
| 38 | SAVE ARTIFACT /usr/share/ansible/collections |
| 39 | SAVE IMAGE --cache-hint |
| 40 | |
| 41 | image: |
Mohammed Naser | da99423 | 2024-04-13 12:34:01 -0400 | [diff] [blame] | 42 | FROM ubuntu:jammy |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame] | 43 | ENV ANSIBLE_PIPELINING=True |
Mohammed Naser | da99423 | 2024-04-13 12:34:01 -0400 | [diff] [blame] | 44 | RUN \ |
| 45 | apt-get update -qq && \ |
| 46 | apt-get install -qq -y --no-install-recommends \ |
Mohammed Naser | 171a757 | 2024-06-25 13:59:04 -0400 | [diff] [blame] | 47 | python3 rsync openssh-client && \ |
Mohammed Naser | da99423 | 2024-04-13 12:34:01 -0400 | [diff] [blame] | 48 | apt-get clean && \ |
| 49 | rm -rf /var/lib/apt/lists/* |
Mohammed Naser | e720d78 | 2023-07-10 15:57:21 -0400 | [diff] [blame] | 50 | COPY +build.venv.runtime/venv /venv |
| 51 | ENV PATH=/venv/bin:$PATH |
| 52 | COPY +build.collections/ /usr/share/ansible |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame] | 53 | ARG tag=latest |
Mohammed Naser | 1dfea6b | 2024-02-09 01:04:26 -0500 | [diff] [blame] | 54 | ARG REGISTRY=ghcr.io/vexxhost/atmosphere |
Mohammed Naser | 1220717 | 2024-02-05 18:49:35 -0500 | [diff] [blame] | 55 | SAVE IMAGE --push ${REGISTRY}:${tag} |