-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
41 lines (39 loc) · 1.74 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
---
stages:
- build
- release
build:
image: quay.io/podman/stable:latest
stage: build
timeout: 3h # Extend default timeout as we're building for non-native architectures
before_script:
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
# Build x86 image, create a container from it and copy the built image out
- podman build -f Dockerfile_x86 --arch=amd64 -t $CI_REGISTRY_IMAGE:x86build .
- podman create --name pinewall-x86 $CI_REGISTRY_IMAGE:x86build
- podman cp pinewall-x86:/opt/pinewall.iso pinewall.iso
## - podman cp pinewall:/opt/pinewall.txt pinewall.iso.txt
# Build Pi image, create a container from it and copy the built image out
- podman build -f Dockerfile_rpi --arch=arm64 -t $CI_REGISTRY_IMAGE:rpibuild .
- podman create --name pinewall-rpi $CI_REGISTRY_IMAGE:rpibuild
- podman cp pinewall-rpi:/opt/pinewall.img.gz pinewall.img.gz
## - podman cp pinewall:/opt/pinewall.txt pinewall.img.gz.txt
artifacts:
paths:
- pinewall.img.gz
## - pinewall.img.gz.txt
- pinewall.iso
## - pinewall.iso.txt
expire_in: 1 day
release:
image: docker.io/curlimages/curl:latest
stage: release
dependencies:
- build
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${CI_PROJECT_DIR}/pinewall.img.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/pinewall/rpi/pinewall.img.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${CI_PROJECT_DIR}/pinewall.iso "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/pinewall/x86/pinewall.iso"'
only:
refs:
- master # Only run the actual release stage if we're running on the master branch (stops us accidentally releasing other branches)