Skip to content

Commit fa2500b

Browse files
authored
Merge pull request #1 from mattclay/init
Inititial setup.
2 parents fe94723 + e422d7c commit fa2500b

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM quay.io/bedrock/alpine:3.16.2 AS builder
2+
3+
RUN apk --no-cache add gcc audit-dev musl-dev
4+
5+
COPY audit-status.c .
6+
RUN gcc -o audit-status audit-status.c -l audit
7+
8+
FROM quay.io/bedrock/alpine:3.16.2
9+
10+
RUN apk --no-cache add audit-libs
11+
12+
COPY --from=builder /audit-status /usr/local/bin/audit-status

audit-status.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <stdio.h>
2+
#include <libaudit.h>
3+
4+
int main() {
5+
printf("%d\n", audit_request_status(audit_open()));
6+
}

azure-pipelines.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
trigger:
2+
batch: true
3+
branches:
4+
include:
5+
- main
6+
- stable-*
7+
tags:
8+
include:
9+
- '*'
10+
11+
pr:
12+
branches:
13+
include:
14+
- main
15+
- stable-*
16+
17+
pool:
18+
vmImage: 'ubuntu-20.04'
19+
20+
variables:
21+
container_name: "quay.io/ansible/$(System.TeamProject)"
22+
scratchpad_tag: "quay.io/ansible/scratchpad:$(System.TeamProject)-$(Build.SourceBranchName)-$(Build.BuildId)"
23+
python_version: '3.10'
24+
containmint_version: '0.2.0'
25+
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
26+
push_or_no_login: --push
27+
${{ else }}:
28+
push_or_no_login: --no-login
29+
30+
stages:
31+
- stage: Build
32+
dependsOn: []
33+
jobs:
34+
- job: Arch
35+
steps:
36+
- task: UsePythonVersion@0
37+
inputs:
38+
versionSpec: '$(python_version)'
39+
displayName: Use Python
40+
- script: pip install containmint==$(containmint_version) --disable-pip-version-check --user
41+
displayName: Install containmint
42+
- script: >
43+
containmint build
44+
--tag "$(scratchpad_tag)-$(System.JobName)"
45+
--arch "$(System.JobName)"
46+
$(push_or_no_login)
47+
displayName: Build
48+
env:
49+
CONTAINMINT_PASSWORD: $(CONTAINMINT_PASSWORD)
50+
strategy:
51+
matrix:
52+
x86_64: {}
53+
aarch64: {}
54+
55+
- stage: Deploy
56+
dependsOn: Build
57+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
58+
jobs:
59+
- job: Image
60+
steps:
61+
- task: UsePythonVersion@0
62+
inputs:
63+
versionSpec: '$(python_version)'
64+
displayName: Use Python
65+
- script: pip install containmint==$(containmint_version) --disable-pip-version-check --user
66+
displayName: Install containmint
67+
- script: >
68+
containmint merge
69+
--push
70+
--tag "$(container_name):$(Build.SourceBranchName)"
71+
"$(scratchpad_tag)-x86_64"
72+
"$(scratchpad_tag)-aarch64"
73+
displayName: Merge
74+
env:
75+
CONTAINMINT_PASSWORD: $(CONTAINMINT_PASSWORD)

0 commit comments

Comments
 (0)