mirror of
https://github.com/docker/bake-action.git
synced 2025-12-30 01:31:20 +01:00
Merge pull request #18 from crazy-max/remove-os-limitation
Remove os limitation
This commit is contained in:
32
.github/workflows/ci.yml
vendored
32
.github/workflows/ci.yml
vendored
@@ -43,7 +43,6 @@ jobs:
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Build and push
|
||||
id: docker_build
|
||||
uses: ./
|
||||
with:
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
@@ -56,3 +55,34 @@ jobs:
|
||||
name: Dump context
|
||||
if: always()
|
||||
uses: crazy-max/ghaction-dump-context@v1
|
||||
|
||||
error:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Stop docker
|
||||
run: |
|
||||
sudo systemctl stop docker
|
||||
-
|
||||
name: Build
|
||||
id: bake
|
||||
continue-on-error: true
|
||||
uses: ./
|
||||
with:
|
||||
files: |
|
||||
./test/config.hcl
|
||||
-
|
||||
name: Check
|
||||
run: |
|
||||
echo "${{ toJson(steps.bake) }}"
|
||||
if [ "${{ steps.bake.outcome }}" != "failure" ] || [ "${{ steps.bake.conclusion }}" != "success" ]; then
|
||||
echo "::error::Should have failed"
|
||||
exit 1
|
||||
fi
|
||||
-
|
||||
name: Dump context
|
||||
if: always()
|
||||
uses: crazy-max/ghaction-dump-context@v1
|
||||
|
||||
@@ -20,7 +20,6 @@ ___
|
||||
* [Customizing](#customizing)
|
||||
* [inputs](#inputs)
|
||||
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
|
||||
* [Limitation](#limitation)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -102,7 +101,3 @@ updates:
|
||||
schedule:
|
||||
interval: "daily"
|
||||
```
|
||||
|
||||
## Limitation
|
||||
|
||||
This action is only available for Linux [virtual environments](https://help.github.com/en/articles/virtual-environments-for-github-actions#supported-virtual-environments-and-hardware-resources).
|
||||
|
||||
17
dist/index.js
generated
vendored
17
dist/index.js
generated
vendored
@@ -516,7 +516,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const os = __importStar(__webpack_require__(87));
|
||||
const buildx = __importStar(__webpack_require__(295));
|
||||
const context = __importStar(__webpack_require__(842));
|
||||
const core = __importStar(__webpack_require__(186));
|
||||
@@ -524,22 +523,22 @@ const exec = __importStar(__webpack_require__(514));
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
if (os.platform() !== 'linux') {
|
||||
core.setFailed('Only supported on linux platform');
|
||||
return;
|
||||
}
|
||||
core.startGroup(`Docker info`);
|
||||
yield exec.exec('docker', ['version']);
|
||||
yield exec.exec('docker', ['info']);
|
||||
core.endGroup();
|
||||
if (!(yield buildx.isAvailable())) {
|
||||
core.setFailed(`Buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
||||
core.setFailed(`Docker buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
||||
return;
|
||||
}
|
||||
const buildxVersion = yield buildx.getVersion();
|
||||
core.info(`📣 Buildx version: ${buildxVersion}`);
|
||||
core.info(`Using buildx ${buildxVersion}`);
|
||||
let inputs = yield context.getInputs();
|
||||
const args = yield context.getArgs(inputs, buildxVersion);
|
||||
core.startGroup(`💡 Bake definition`);
|
||||
core.startGroup(`Bake definition`);
|
||||
yield exec.exec('docker', [...args, '--print']);
|
||||
core.endGroup();
|
||||
core.info(`🏃 Building...`);
|
||||
core.info(`Building...`);
|
||||
yield exec.exec('docker', args);
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
17
src/main.ts
17
src/main.ts
@@ -1,4 +1,3 @@
|
||||
import * as os from 'os';
|
||||
import * as buildx from './buildx';
|
||||
import * as context from './context';
|
||||
import * as core from '@actions/core';
|
||||
@@ -6,27 +5,27 @@ import * as exec from '@actions/exec';
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
if (os.platform() !== 'linux') {
|
||||
core.setFailed('Only supported on linux platform');
|
||||
return;
|
||||
}
|
||||
core.startGroup(`Docker info`);
|
||||
await exec.exec('docker', ['version']);
|
||||
await exec.exec('docker', ['info']);
|
||||
core.endGroup();
|
||||
|
||||
if (!(await buildx.isAvailable())) {
|
||||
core.setFailed(`Buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
||||
core.setFailed(`Docker buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const buildxVersion = await buildx.getVersion();
|
||||
core.info(`📣 Buildx version: ${buildxVersion}`);
|
||||
core.info(`Using buildx ${buildxVersion}`);
|
||||
|
||||
let inputs: context.Inputs = await context.getInputs();
|
||||
const args: string[] = await context.getArgs(inputs, buildxVersion);
|
||||
|
||||
core.startGroup(`💡 Bake definition`);
|
||||
core.startGroup(`Bake definition`);
|
||||
await exec.exec('docker', [...args, '--print']);
|
||||
core.endGroup();
|
||||
|
||||
core.info(`🏃 Building...`);
|
||||
core.info(`Building...`);
|
||||
await exec.exec('docker', args);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
|
||||
Reference in New Issue
Block a user