Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix parameter for triggering reproducible Nix buildspec #36

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions code-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async function build(sdk, params, config) {
branch: params.branch,
sourceVersion: params.sourceVersion,
reproducible: params.reproducible,
useNix: params.useNix,
gpSshPrivateKeyB64: params.gpSshPrivateKeyB64,
imageTag,
}),
Expand Down Expand Up @@ -101,15 +102,15 @@ async function waitForBuildEndTime(
})
),
!hideCloudWatchLogs &&
logGroupName &&
cloudWatchLogs.send(
new GetLogEventsCommand({
logGroupName,
logStreamName,
startFromHead,
nextToken,
})
),
logGroupName &&
cloudWatchLogs.send(
new GetLogEventsCommand({
logGroupName,
logStreamName,
startFromHead,
nextToken,
})
),
]).catch((err) => {
errObject = err;
/* Returning [] here so that the assignment above
Expand Down Expand Up @@ -206,9 +207,13 @@ function githubInputs() {

// default to non-reproducible builds
var reproducible = false;
var useNix = false;
if (process.env[`REPRODUCIBLE`] == "true") {
// we want a reproducible build
reproducible = true;
if (process.env[`USE_NIX`] == "true") {
useNix = true;
}
}

const { payload } = github.context;
Expand Down Expand Up @@ -252,6 +257,7 @@ function githubInputs() {
branch,
sourceVersion,
reproducible,
useNix,
updateInterval,
updateBackOff,
hideCloudWatchLogs,
Expand All @@ -267,6 +273,7 @@ function inputs2Parameters(inputs) {
branch,
sourceVersion,
reproducible,
useNix,
gpSshPrivateKeyB64,
} = inputs;

Expand All @@ -278,6 +285,7 @@ function inputs2Parameters(inputs) {
branch,
sourceVersion,
reproducible,
useNix,
gpSshPrivateKeyB64,
};
}
Expand Down
26 changes: 17 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ async function build(sdk, params, config) {
branch: params.branch,
sourceVersion: params.sourceVersion,
reproducible: params.reproducible,
useNix: params.useNix,
gpSshPrivateKeyB64: params.gpSshPrivateKeyB64,
imageTag,
}),
Expand Down Expand Up @@ -107,15 +108,15 @@ async function waitForBuildEndTime(
})
),
!hideCloudWatchLogs &&
logGroupName &&
cloudWatchLogs.send(
new GetLogEventsCommand({
logGroupName,
logStreamName,
startFromHead,
nextToken,
})
),
logGroupName &&
cloudWatchLogs.send(
new GetLogEventsCommand({
logGroupName,
logStreamName,
startFromHead,
nextToken,
})
),
]).catch((err) => {
errObject = err;
/* Returning [] here so that the assignment above
Expand Down Expand Up @@ -212,9 +213,13 @@ function githubInputs() {

// default to non-reproducible builds
var reproducible = false;
var useNix = false;
if (process.env[`REPRODUCIBLE`] == "true") {
// we want a reproducible build
reproducible = true;
if (process.env[`USE_NIX`] == "true") {
useNix = true;
}
}

const { payload } = github.context;
Expand Down Expand Up @@ -258,6 +263,7 @@ function githubInputs() {
branch,
sourceVersion,
reproducible,
useNix,
updateInterval,
updateBackOff,
hideCloudWatchLogs,
Expand All @@ -273,6 +279,7 @@ function inputs2Parameters(inputs) {
branch,
sourceVersion,
reproducible,
useNix,
gpSshPrivateKeyB64,
} = inputs;

Expand All @@ -284,6 +291,7 @@ function inputs2Parameters(inputs) {
branch,
sourceVersion,
reproducible,
useNix,
gpSshPrivateKeyB64,
};
}
Expand Down
Loading