Skip to content

Commit 0e57002

Browse files
committed
fixup! Use Signed Binaries for Docker Build
1 parent 060e2f9 commit 0e57002

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

.pipelines/build/images.jobs.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ jobs:
5454
inputs:
5555
scriptPath: $(REPO_ROOT)/${{ job_data.templateContext.buildScript }}
5656

57-
# - task: ExtractFiles@1
58-
# inputs:
59-
# archiveFilePatterns: '**/*.?(tgz|tgz.gz|zip)'
60-
# destinationFolder: $(OUT_DIR)
61-
# cleanDestinationFolder: false
62-
# overwriteExistingFiles: true
63-
6457
- script: |
6558
ls -la "$SOURCE"
6659
cp "$SOURCE" "$DEST"

.pipelines/build/scripts/azure-ipam.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ export CGO_ENABLED=0
88
mkdir -p "$OUT_DIR"/bin
99
mkdir -p "$OUT_DIR"/files
1010

11-
pushd "$ROOT_DIR"/azure-ipam
11+
pushd "$REPO_ROOT"/azure-ipam
1212
go build -v -a -trimpath \
1313
-o "$OUT_DIR"/bin/azure-ipam \
14-
-ldflags "-X github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo.Version="$AZURE_IPAM_VERSION" -X main.version="$AZURE_IPAM_VERSION"" \
15-
-gcflags="-dwarflocationlists=true" \
14+
-ldflags "-X github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo.Version="$AZURE_IPAM_VERSION" -X main.version="$AZURE_IPAM_VERSION"" \
15+
-gcflags="-dwarflocationlists=true" \
16+
main.go
1617

1718
cp *.conflist "$OUT_DIR"/files/
1819
popd

.pipelines/build/scripts/dropgz.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,34 @@ export GOOS=$OS
22
export GOARCH=$ARCH
33
export CGO_ENABLED=0
44

5-
DROPGZ_VERSION="${DROPGZ_VERSION:-v0.0.12}"
65
DROPGZ_BUILD_DIR=$(mktemp -d -p "$GEN_DIR")
6+
PAYLOAD_DIR=$(mktemp -d -p "$GEN_DIR")
7+
DROPGZ_VERSION="${DROPGZ_VERSION:-v0.0.12}"
78
DROPGZ_MOD_DOWNLOAD_PATH=""$ACN_PACKAGE_PATH"/dropgz@"$DROPGZ_VERSION""
89

910
mkdir -p "$OUT_DIR"/bin
1011
mkdir -p "$DROPGZ_BUILD_DIR"
1112

13+
echo >&2 "##[section]Construct DropGZ Embedded Payload"
14+
pushd "$PAYLOAD_DIR"
15+
[[ -n $(stat "$OUT_DIR"/files 2>/dev/null || true) ]] && cp "$OUT_DIR"/files/* .
16+
[[ -n $(stat "$OUT_DIR"/bin 2>/dev/null || true) ]] && cp "$OUT_DIR"/bin/* .
17+
18+
sha256sum * > sum.txt
19+
gzip --verbose --best --recursive .
20+
21+
for file in $(find . -name '*.gz'); do
22+
mv "$file" "${file%%.gz}"
23+
done
24+
popd
25+
26+
echo >&2 "##[section]Download DropGZ ($DROPGZ_VERSION)"
1227
GOPATH="$DROPGZ_BUILD_DIR" \
1328
go mod download "$DROPGZ_MOD_DOWNLOAD_PATH"
1429

30+
echo >&2 "##[section]Build DropGZ with Embedded Payload"
1531
pushd "$DROPGZ_BUILD_DIR"/pkg/mod/"$DROPGZ_MOD_DOWNLOAD_PATH"
16-
[[ -n $(stat "$OUT_DIR"/files 2>/dev/null || true) ]] && cp "$OUT_DIR"/files/* pkg/embed/fs/
17-
[[ -n $(stat "$OUT_DIR"/bin 2>/dev/null || true) ]] && cp "$OUT_DIR"/bin/* pkg/embed/fs/
32+
mv "$PAYLOAD_DIR"/* pkg/embed/fs/
1833
go build -v -trimpath -a \
1934
-o "$OUT_DIR"/bin/dropgz \
2035
-ldflags "-X github.com/Azure/azure-container-networking/dropgz/internal/buildinfo.Version="$DROPGZ_VERSION"" \

.pipelines/build/scripts/npm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export CGO_ENABLED=0
88
mkdir -p "$OUT_DIR"/files
99
mkdir -p "$OUT_DIR"/bin
1010

11-
pushd "$ROOT_DIR"/npm
11+
pushd "$REPO_ROOT"/npm
1212
go build -a -v -trimpath \
1313
-o "$OUT_DIR"/bin/azure-npm \
1414
-ldflags "-X main.version="$NPM_VERSION" -X "$NPM_AI_PATH"="$NPM_AI_ID"" \

0 commit comments

Comments
 (0)