-
-
Notifications
You must be signed in to change notification settings - Fork 8
94 lines (83 loc) · 2.54 KB
/
ocipkg.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: ocipkg
on:
push:
branches:
- main
- dev-*
pull_request: {}
jobs:
pack:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: pack src/
run: |
ocipkg pack ocipkg/src/ out.tar -t test_repo/testing:tag1
- name: Testing podman can load the generated container
run: |
podman load < out.tar
podman images | grep test_repo/testing | grep tag1
load:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Create test oci-archive using podman
run: |
podman pull alpine
podman save -o oci-alpine.tar --format oci-archive alpine
- name: load oci-archive
run: |
ocipkg load oci-alpine.tar
- name: Show alpine version
run: cat $HOME/.local/share/ocipkg/docker.io/library/alpine/__latest/etc/alpine-release
get:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: get image of old style (OCI image spec 1.0 based) from ghcr.io
run: |
ocipkg get ghcr.io/termoshtt/ocipkg/dynamic/rust:1d23f83
- name: get image of new style (OCI Artifact based) from ghcr.io
run: |
ocipkg get ghcr.io/termoshtt/ocipkg/static/rust:9a042e8
- name: ocipkg list
run: test $(ocipkg list | wc -l) -eq 2
push:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: pack src/ and push
run: |
ocipkg pack ocipkg/src out.tar -t localhost:5000/test_repo:new_tag
ocipkg push out.tar
- name: Test image has been pushed
run: curl -sf localhost:5000/v2/test_repo/tags/list | jq -e '.tags[] | select(test("new_tag"))'
services:
registry:
image: registry:2
ports:
- 5000:5000