ci: add publish squashfs layers
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
parent
92a680299f
commit
093acb5ad5
33
.github/workflows/ci.yaml
vendored
33
.github/workflows/ci.yaml
vendored
@ -17,7 +17,6 @@ jobs:
|
|||||||
name: Test stacker-build-push-action
|
name: Test stacker-build-push-action
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Run stacker-build with a Dockerfile
|
- name: Run stacker-build with a Dockerfile
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -98,3 +97,35 @@ jobs:
|
|||||||
url: docker://localhost:5000/five/app
|
url: docker://localhost:5000/five/app
|
||||||
layer-type: 'tar squashfs'
|
layer-type: 'tar squashfs'
|
||||||
skip-tls: true
|
skip-tls: true
|
||||||
|
|
||||||
|
- name: Run stacker-build with push, tags, build-args and layer-type(squashfs)
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
file: 'test/stacker.yaml'
|
||||||
|
build-args: |
|
||||||
|
SUB1=VAR1
|
||||||
|
SUB2=VAR2
|
||||||
|
SUB3=VAR3
|
||||||
|
tags: v1 latest
|
||||||
|
url: docker://localhost:5000/six/app
|
||||||
|
layer-type: 'squashfs'
|
||||||
|
skip-tls: true
|
||||||
|
|
||||||
|
- name: Check images were published
|
||||||
|
run: |
|
||||||
|
docker pull localhost:5000/one/app/test:v1
|
||||||
|
docker pull localhost:5000/one/app/test
|
||||||
|
docker pull localhost:5000/two/app/test:v1
|
||||||
|
docker pull localhost:5000/two/app/test
|
||||||
|
docker pull localhost:5000/three/app/test:v1
|
||||||
|
docker pull localhost:5000/three/app/test
|
||||||
|
docker pull localhost:5000/four/app/app:v1
|
||||||
|
docker pull localhost:5000/four/app/app
|
||||||
|
docker pull localhost:5000/five/app/layer3_1:v2
|
||||||
|
docker pull localhost:5000/five/app/layer3_1:v2
|
||||||
|
|
||||||
|
# check squashfs
|
||||||
|
curl http://localhost:5000/v2/six/app/test/manifests/v1-squashfs
|
||||||
|
curl http://localhost:5000/v2/six/app/test/manifests/latest-squashfs
|
||||||
|
curl http://localhost:5000/v2/five/app/layer3_2/manifests/v2-squashfs
|
||||||
|
curl http://localhost:5000/v2/five/app/layer3_1/manifests/v2-squashfs
|
||||||
|
@ -25,7 +25,7 @@ inputs:
|
|||||||
file-pattern:
|
file-pattern:
|
||||||
description: 'regex pattern to use when searching for stackerfile paths, used with dir arg'
|
description: 'regex pattern to use when searching for stackerfile paths, used with dir arg'
|
||||||
required: false
|
required: false
|
||||||
default: '\\/stacker.yaml$'
|
default: 'stacker.yaml'
|
||||||
layer-type:
|
layer-type:
|
||||||
description: 'Set the output layer type (supported values: tar, squashfs) separated by whitespace'
|
description: 'Set the output layer type (supported values: tar, squashfs) separated by whitespace'
|
||||||
required: false
|
required: false
|
||||||
@ -41,7 +41,7 @@ inputs:
|
|||||||
description: 'Tags used when pushing to remote OCI registry, separated by whitespace'
|
description: 'Tags used when pushing to remote OCI registry, separated by whitespace'
|
||||||
required: false
|
required: false
|
||||||
url:
|
url:
|
||||||
description: 'Remote registry URL, eg: docker://ghcr.io/myRepo'
|
description: 'Remote registry URL, eg: docker://ghcr.io/myrepo'
|
||||||
required: false
|
required: false
|
||||||
username:
|
username:
|
||||||
description: 'Username for the remote registry'
|
description: 'Username for the remote registry'
|
||||||
|
3
dist/index.js
vendored
3
dist/index.js
vendored
@ -12462,6 +12462,7 @@ class StackerCLI {
|
|||||||
build(stackerfile, cachedir, stackerdir, stackerfilePattern, layerType, substitutes, subfile) {
|
build(stackerfile, cachedir, stackerdir, stackerfilePattern, layerType, substitutes, subfile) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const args = ["--debug"];
|
const args = ["--debug"];
|
||||||
|
core.info(`building`);
|
||||||
args.push("--stacker-dir");
|
args.push("--stacker-dir");
|
||||||
args.push(cachedir);
|
args.push(cachedir);
|
||||||
if (stackerdir) {
|
if (stackerdir) {
|
||||||
@ -12501,6 +12502,7 @@ class StackerCLI {
|
|||||||
publish(stackerfile, cachedir, stackerdir, stackerfilePattern, layerType, substitutes, subfile, url, tags, username, password, skipTLS) {
|
publish(stackerfile, cachedir, stackerdir, stackerfilePattern, layerType, substitutes, subfile, url, tags, username, password, skipTLS) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const args = ["--debug"];
|
const args = ["--debug"];
|
||||||
|
core.info(`publishing`);
|
||||||
args.push("--stacker-dir");
|
args.push("--stacker-dir");
|
||||||
args.push(cachedir);
|
args.push(cachedir);
|
||||||
args.push("publish");
|
args.push("publish");
|
||||||
@ -12732,7 +12734,6 @@ function run() {
|
|||||||
const substitutes = getInputList("build-args");
|
const substitutes = getInputList("build-args");
|
||||||
var subfile = core.getInput("build-args-file");
|
var subfile = core.getInput("build-args-file");
|
||||||
const layerTypes = getSpaceSeparatedInput("layer-type");
|
const layerTypes = getSpaceSeparatedInput("layer-type");
|
||||||
core.info(`dockerfile val: ${dockerfile}`);
|
|
||||||
if (dockerfile) {
|
if (dockerfile) {
|
||||||
let [cmdRes, convertRes] = yield cli.convertDockerfile(dockerfile);
|
let [cmdRes, convertRes] = yield cli.convertDockerfile(dockerfile);
|
||||||
if (convertRes && (yield cmdRes).exitCode == 0) {
|
if (convertRes && (yield cmdRes).exitCode == 0) {
|
||||||
|
@ -61,7 +61,6 @@ export async function run(): Promise<void> {
|
|||||||
// get layer-type from input
|
// get layer-type from input
|
||||||
const layerTypes = utils.getSpaceSeparatedInput("layer-type");
|
const layerTypes = utils.getSpaceSeparatedInput("layer-type");
|
||||||
|
|
||||||
core.info(`dockerfile val: ${dockerfile}`);
|
|
||||||
if (dockerfile) {
|
if (dockerfile) {
|
||||||
let [cmdRes, convertRes] = await cli.convertDockerfile(dockerfile);
|
let [cmdRes, convertRes] = await cli.convertDockerfile(dockerfile);
|
||||||
|
|
||||||
|
@ -64,6 +64,8 @@ export class StackerCLI {
|
|||||||
layerType: string[], substitutes: string[], subfile: string): Promise<CommandResult> {
|
layerType: string[], substitutes: string[], subfile: string): Promise<CommandResult> {
|
||||||
const args: string[] = ["--debug"];
|
const args: string[] = ["--debug"];
|
||||||
|
|
||||||
|
core.info(`building`);
|
||||||
|
|
||||||
args.push("--stacker-dir");
|
args.push("--stacker-dir");
|
||||||
args.push(cachedir);
|
args.push(cachedir);
|
||||||
|
|
||||||
@ -102,7 +104,7 @@ export class StackerCLI {
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
})
|
})
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,6 +112,8 @@ export class StackerCLI {
|
|||||||
subfile: string, url: string, tags: string[], username: string, password: string, skipTLS: boolean): Promise<CommandResult> {
|
subfile: string, url: string, tags: string[], username: string, password: string, skipTLS: boolean): Promise<CommandResult> {
|
||||||
const args: string[] = ["--debug"];
|
const args: string[] = ["--debug"];
|
||||||
|
|
||||||
|
core.info(`publishing`);
|
||||||
|
|
||||||
args.push("--stacker-dir");
|
args.push("--stacker-dir");
|
||||||
args.push(cachedir);
|
args.push(cachedir);
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@ layer1_1:
|
|||||||
type: docker
|
type: docker
|
||||||
url: docker://centos:latest
|
url: docker://centos:latest
|
||||||
import:
|
import:
|
||||||
- import1
|
- importfile1
|
||||||
run: |
|
run: |
|
||||||
cp /stacker/imports/import1 /root/import1
|
cp /stacker/imports/importfile1 /root/importfile1
|
||||||
layer1_2:
|
layer1_2:
|
||||||
from:
|
from:
|
||||||
type: docker
|
type: docker
|
||||||
url: docker://centos:latest
|
url: docker://centos:latest
|
||||||
run:
|
run:
|
||||||
touch /root/import0
|
touch /root/importfile0
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
config:
|
config:
|
||||||
prerequisites:
|
prerequisites:
|
||||||
- ../sub1/stacker.yaml
|
- ../first/stacker.yaml
|
||||||
layer2:
|
layer2:
|
||||||
from:
|
from:
|
||||||
type: built
|
type: built
|
||||||
tag: layer1_1
|
tag: layer1_1
|
||||||
import:
|
import:
|
||||||
- import2
|
- importfile2
|
||||||
run: |
|
run: |
|
||||||
cp /stacker/imports/import2 /root/import2
|
cp /stacker/imports/importfile2 /root/importfile2
|
||||||
cp /root/import1 /root/import1_copied
|
cp /root/importfile1 /root/importfile1_copied
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
config:
|
config:
|
||||||
prerequisites:
|
prerequisites:
|
||||||
- ../sub1/stacker.yaml
|
- ../first/stacker.yaml
|
||||||
- ../sub2/stacker.yaml
|
- ../second/stacker.yaml
|
||||||
layer3_1:
|
layer3_1:
|
||||||
from:
|
from:
|
||||||
type: built
|
type: built
|
||||||
tag: layer2
|
tag: layer2
|
||||||
run: |
|
run: |
|
||||||
cp /root/import2 /root/import2_copied
|
cp /root/importfile2 /root/importfile2_copied
|
||||||
layer3_2:
|
layer3_2:
|
||||||
from:
|
from:
|
||||||
type: built
|
type: built
|
||||||
tag: layer1_2
|
tag: layer1_2
|
||||||
run: |
|
run: |
|
||||||
cp /root/import0 /root/import0_copied
|
cp /root/importfile0 /root/importfile0_copied
|
||||||
|
Loading…
Reference in New Issue
Block a user