Skip to content

Commit 9c09fa2

Browse files
fixing merge conflicts
2 parents 306d233 + 9e0fcbe commit 9c09fa2

9 files changed

Lines changed: 578 additions & 18 deletions

File tree

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,15 @@ anything with `T("some string here")` uses the internationalization system. Defi
326326
The string passed into the `T()` function serves as the ID when looking these up. So the ID Will need to be present in all i18n files, it will also need a translation string.
327327

328328
[i18n4go](https://github.com/maximilien/i18n4go) is used to make sure all strings being transalted have translations. To test run this command.
329+
330+
For i18n4go, we specifically use v0.2.4 for now, so we have a prebuilt binary in `./bin/i18n4go`. If that binary needs to be rebuilt, use the SoftLayer fork at https://github.com/softlayer/i18n4go (which is set to the version we need, along with some updates since that version had a bug with --help).
331+
332+
This command will build the Mac (arm64) version. Replace GOOS and GOARCH with the OS/Architecture you need to build for.
333+
```
334+
~/go/src/github.ibm.com/softlayer/softlayer-cli/i18n4go (master)
335+
$> GOOS=darwin GOARCH=arm64 go build -o i18n4go_mac -ldflags "-s -w" i18n4go/i18n4go.go
336+
```
337+
329338
[go-i18n](https://github.com/nicksnyder/go-i18n/) is what is actually doing the translations, but its using an old v1 version.
330339
[go-bindata](https://github.com/jteeuwen/go-bindata) takes the json files, and turns them into a go binary.
331340

@@ -470,4 +479,19 @@ It("return error", func() {
470479
Expect(err).To(HaveOccurred())
471480
Expect(err.Error()).To(ContainSubstring("Failed to show hardware."))
472481
})
473-
```
482+
```
483+
484+
485+
# Plugin Support / Release Process
486+
After v1.4.1 `sl` will be a normal plugin, so where are the instructions to build the plugin.
487+
488+
0. Create a new version and tag it in github like normal.
489+
1. Build the binaries.
490+
```bash
491+
./bin/build-all
492+
for i in `ls --indicator-style=none out`; do echo "Uploading $i"; ibmcloud.exe cos upload --bucket softlayer-cli-binaries --file ./out/$i --key $i; done;
493+
```
494+
2. Run the Jenkins job https://wcp-cloud-foundry-jenkins.swg-devops.com/job/Publish%20Plugin%20to%20YS1/
495+
496+
## TODO
497+
Automate build with https://github.ibm.com/coligo/cli/tree/main/script

bin/build-all

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ build() {
99
local os=$1
1010
local arch=$2
1111

12-
GOOS=$os GOARCH=$arch $ROOT_DIR/bin/build
12+
GOOS=$os GOARCH=$arch go build -ldflags "-s -w" -o $ROOT_DIR/out/sl .
1313

14-
for f in ibmcloud; do
14+
for f in sl; do
1515
nf="$f-$os-$arch"
1616
if [ "$os" == "windows" ]; then
1717
nf="$nf.exe"
@@ -21,17 +21,30 @@ build() {
2121
done
2222
}
2323

24+
echo "Generating i18n resource file ..."
25+
if [[ "$OSTYPE" == "msys"* ]]; then
26+
# For SO windows
27+
./bin/go-bindata.exe -pkg resources -o plugin/resources/i18n_resources.go plugin/i18n/resources
28+
else
29+
./bin/go-bindata -pkg resources -o plugin/resources/i18n_resources.go plugin/i18n/resources
30+
fi
31+
echo "Done."
32+
33+
34+
echo "Building Binaries ..."
2435
# disable CGO for Linux
2536
CGO_ENABLED=0 build linux amd64
2637
CGO_ENABLED=0 build linux 386
2738
CGO_ENABLED=0 build linux arm64
2839

2940
build darwin amd64
41+
build darwin arm64
3042

3143
build linux ppc64le
3244
build linux s390x
3345

3446
build windows amd64
3547
build windows 386
3648

37-
shasum $ROOT_DIR/out/ibmcloud-*
49+
echo "Generating binary hases ..."
50+
shasum $ROOT_DIR/out/sl-*

0 commit comments

Comments
 (0)