-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
50 lines (44 loc) · 2.01 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
image: "quay.io/podman/testing"
before_script:
- podman --version
stages:
- Static analysis
- Compiles
- Publish latest to quay
rustfmt:
stage: Static analysis
script:
- curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly -y
- source $HOME/.cargo/env
- cargo fmt -- --check
compile-amd64:
stage: Compiles
script:
- podman build --runtime crun --storage-driver vfs -t teatro:amd64 .
- if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ] && [ "$QUAY_USERNAME" != "" ] && [ "$QUAY_PASSWORD" != "" ]; then
podman --storage-driver vfs login quay.io --username $QUAY_USERNAME --password $QUAY_PASSWORD &&
podman --storage-driver vfs push teatro:amd64 quay.io/$QUAY_USERNAME/teatro:amd64;
fi
compile-arm64:
stage: Compiles
script:
- podman build --runtime crun --storage-driver vfs --arch arm64
--build-arg RUST_TARGET="aarch64-unknown-linux-musl"
--build-arg MUSL_TARGET="aarch64-linux-musl"
-t teatro:arm64 .
- if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ] && [ "$QUAY_USERNAME" != "" ] && [ "$QUAY_PASSWORD" != "" ]; then
podman --storage-driver vfs login quay.io --username $QUAY_USERNAME --password $QUAY_PASSWORD &&
podman --storage-driver vfs push teatro:arm64 quay.io/$QUAY_USERNAME/teatro:arm64;
fi
publish-latest:
stage: Publish latest to quay
only:
- current@Adrian/teatro
script:
- podman --storage-driver vfs login quay.io --username $QUAY_USERNAME --password $QUAY_PASSWORD
- podman --storage-driver vfs manifest create teatro:latest
- podman --storage-driver vfs pull quay.io/$QUAY_USERNAME/teatro:arm64
- podman --storage-driver vfs pull quay.io/$QUAY_USERNAME/teatro:amd64
- podman --storage-driver vfs manifest add teatro:latest quay.io/$QUAY_USERNAME/teatro:amd64
- podman --storage-driver vfs manifest add teatro:latest quay.io/$QUAY_USERNAME/teatro:arm64
- podman --storage-driver vfs manifest push teatro:latest docker://quay.io/$QUAY_USERNAME/teatro:latest