generated from pulumi/pulumi-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Our docs and default value for the GitHub action cache URL were referring to the [wrong](https://github.com/tonistiigi/go-actions-cache/blob/master/api.md) environment variable. I was under the impression that the underlying library ends up checking for the correct variable later so this would be only cosmetic, but a user [confirmed](#77 (comment)) this does appear to break things. I brought over an old test I had written while this was still in the pulumi-docker repo, but unfortunately it doesn't currently test GHA due to ci-mgmt limitations #82. Fixes #77.
- Loading branch information
Showing
22 changed files
with
2,228 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Unreleased | ||
|
||
### Fixed | ||
|
||
- Fixed the default value for `ACTIONS_CACHE_URL` when using GitHub action caching. (https://github.com/pulumi/pulumi-docker-build/pull/80) | ||
|
||
## 0.0.2 (2024-04-25) | ||
|
||
### Fixed | ||
|
||
- Upgraded pulumi-go-provider to fix a panic during cancellation. | ||
|
||
## 0.0.1 (2024-04-23) | ||
|
||
Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.21.6-alpine3.18 as initial | ||
ARG SLEEP_SECONDS | ||
RUN sleep ${SLEEP_SECONDS} && echo ${SLEEP_SECONDS} > output | ||
|
||
FROM alpine:3.18 as final | ||
COPY --from=initial /go/output output | ||
RUN cat output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: test-buildx-caching | ||
runtime: nodejs | ||
description: A minimal TypeScript Pulumi program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as buildx from "@pulumi/docker-build"; | ||
import * as pulumi from "@pulumi/pulumi"; | ||
|
||
const config = new pulumi.Config(); | ||
|
||
const start = new Date().getTime(); | ||
|
||
// docker buildx build \ | ||
// -f Dockerfile \ | ||
// --cache-to type=local,dest=tmp,mode=max,oci-mediatypes=true \ | ||
// --cache-from type=local,src=tmp \ | ||
// --build-arg SLEEP-MS=$SLEEP_MS \ | ||
// -t not-pushed \ | ||
// -f Dockerfile \ | ||
// . | ||
const img = new buildx.Image(`buildx-${config.require("name")}`, { | ||
tags: ["not-pushed"], | ||
dockerfile: { location: "Dockerfile" }, | ||
push: false, | ||
context: { location: "." }, | ||
buildArgs: { | ||
SLEEP_SECONDS: config.require("SLEEP_SECONDS"), | ||
}, | ||
cacheTo: [{ raw: config.require("cacheTo") }], | ||
cacheFrom: [{ raw: config.require("cacheFrom") }], | ||
// Set registry auth if it was provided. | ||
registries: config.require("username") | ||
? [ | ||
{ | ||
address: config.getSecret("address"), | ||
username: config.getSecret("username"), | ||
password: config.getSecret("password"), | ||
}, | ||
] | ||
: undefined, | ||
}); | ||
|
||
export const durationSeconds = img.ref.apply( | ||
(_) => (new Date().getTime() - start) / 1000.0 | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "test-buildx-caching", | ||
"devDependencies": { | ||
"@types/node": "^20.0.0" | ||
}, | ||
"dependencies": { | ||
"@pulumi/pulumi": "^3.0.0" | ||
} | ||
} |
Oops, something went wrong.