Skip to content

Commit

Permalink
Merge pull request #11 from amp-buildpacks/update/pipeline
Browse files Browse the repository at this point in the history
Bump pipeline from 1.37.5 to 1.37.5
  • Loading branch information
wangeguo authored Apr 5, 2024
2 parents 3a571fc + 74f2929 commit dc313d5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 45 deletions.
43 changes: 17 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
### Go template
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
# Copyright 2018-2020 the original author or authors.
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
bin

# Dependency directories (remove the comment below to include it)
# vendor/
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Go workspace file
go.work
bin/
linux/
dependencies/
package/
scratch/

# ide
.idea
.github
!.github/pipeline-descriptor.yml
!.github/workflows/pb-update-pipeline.yml
27 changes: 8 additions & 19 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
#!/usr/bin/env bash
# Copyright (c) The Amphitheatre Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euo pipefail

GOMOD=$(head -1 go.mod | awk '{print $2}')
GOOS="linux" go build -ldflags='-s -w' -o bin/main ${GOMOD}/cmd/main
GOOS="linux" go build -ldflags='-s -w' -o linux/amd64/bin/main "$GOMOD/cmd/main"
GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/main "$GOMOD/cmd/main"

if [ "${STRIP:-false}" != "false" ]; then
strip bin/main
strip linux/amd64/bin/main linux/arm64/bin/main
fi

if [ "${COMPRESS:-none}" != "none" ]; then
$COMPRESS bin/main
$COMPRESS linux/amd64/bin/main linux/arm64/bin/main
fi

ln -fs main bin/build
ln -fs main bin/detect
ln -fs main linux/amd64/bin/build
ln -fs main linux/arm64/bin/build
ln -fs main linux/amd64/bin/detect
ln -fs main linux/arm64/bin/detect

0 comments on commit dc313d5

Please sign in to comment.