-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
568e80f
commit fff6ac3
Showing
11 changed files
with
163 additions
and
4 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 |
---|---|---|
|
@@ -12,3 +12,5 @@ build/_output | |
target/ | ||
|
||
.envrc | ||
|
||
/dist |
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,41 @@ | ||
# Make sure to check the documentation at http://goreleaser.com | ||
before: | ||
hooks: | ||
- go mod download | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
hooks: | ||
pre: ./hack/before_release.sh {{ .Tag }} | ||
main: ./cmd/manager/main.go | ||
binary: yaks | ||
ldflags: -X github.com/jboss-fuse/yaks/version.Version={{ .Tag }} | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
dockers: | ||
- dockerfile: ./build/Dockerfile.release | ||
extra_files: | ||
- build | ||
image_templates: | ||
- 'docker.io/yaks/yaks:{{ .Tag }}' | ||
- 'docker.io/yaks/yaks:v{{ .Major }}.{{ .Minor }}' | ||
- 'docker.io/yaks/yaks:latest' |
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,34 @@ | ||
# This is the same of the other Dockerfile but with the binary built by goreleaser | ||
FROM fabric8/s2i-java:3.0-java8 | ||
|
||
ENV OPERATOR=/usr/local/bin/yaks \ | ||
OPERATOR_ARGS=operator \ | ||
USER_UID=1001 \ | ||
USER_NAME=yaks \ | ||
HOME=/root \ | ||
APP_DIR=/deployments/data/yaks-testing \ | ||
APP_LIBS=/deployments/artifacts/m2 | ||
|
||
# install operator binary | ||
COPY yaks ${OPERATOR} | ||
|
||
COPY build/bin /usr/local/bin | ||
|
||
# TODO create a more efficient way to manage dependencies than to hardcode them | ||
COPY build/_maven_repository ${APP_LIBS} | ||
|
||
# add YAKS runtime | ||
COPY build/_maven_project/yaks-testing ${APP_DIR} | ||
|
||
USER 0 | ||
RUN /usr/local/bin/user_setup | ||
|
||
RUN chgrp -R 0 ${APP_LIBS} && \ | ||
chmod -R g=u ${APP_LIBS} | ||
|
||
RUN chgrp -R 0 ${APP_DIR} && \ | ||
chmod -R g=u ${APP_DIR} | ||
|
||
# Let's not use ENTRYPOINT so we can override libs in the base image | ||
|
||
USER ${USER_UID} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,31 @@ | ||
#!/bin/sh | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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 | ||
# | ||
# http://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. | ||
|
||
location=$(dirname $0) | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "usage: $0 version" | ||
exit 1 | ||
fi | ||
|
||
cd $location/.. | ||
|
||
for f in ./deploy/*.yaml; do | ||
sed -i "s/image:.*yaks\/yaks.*$/image: yaks\/yaks:$1/g" $f | ||
done | ||
|
||
make clean build-resources package-artifacts-no-test |
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,49 @@ | ||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You 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 | ||
http://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. | ||
*/ | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/jboss-fuse/yaks/version" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func newCmdVersion(rootCmdOptions *RootCmdOptions) *cobra.Command { | ||
options := versionCmdOptions{ | ||
RootCmdOptions: rootCmdOptions, | ||
} | ||
|
||
cmd := cobra.Command{ | ||
PersistentPreRunE: options.preRun, | ||
Use: "version", | ||
Short: "Return version information", | ||
RunE: options.run, | ||
} | ||
|
||
return &cmd | ||
} | ||
|
||
type versionCmdOptions struct { | ||
*RootCmdOptions | ||
} | ||
|
||
func (o *versionCmdOptions) run(cmd *cobra.Command, _ []string) error { | ||
_, err := fmt.Fprintln(cmd.OutOrStdout(), version.Version) | ||
return err | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package version | ||
|
||
var ( | ||
Version = "0.0.2" | ||
Version = "devel" | ||
) |