Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ dist/
profile.cov
profile.out
.vendor
.goxc.local.json
49 changes: 49 additions & 0 deletions .goxc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"AppName": "scw",
"ArtifactsDest": "dist",
"OutPath": "{{.Dest}}{{.PS}}{{.Version}}{{.PS}}{{.Os}}_{{.Arch}}{{.PS}}{{.ExeName}}{{.Ext}}",
"Tasks": [
"default",
"deb-source",
"downloads-page"
],
"TasksExclude": [
"go-test",
"bintray",
"go-vet",
"rmbin",
"publish-github"
],
"BuildConstraints": "darwin linux windows freebsd netbsd",
"ResourcesExclude": "*.go .goxc-temp",
"MainDirsExclude": "vendor,Godeps,testdata",
"PackageVersion": "v1.4.0-rc1",
"TaskSettings": {
"bintray": {
"downloadspage": "bintray.md",
"package": "scaleway-cli",
"repository": "utils",
"subject": "scaleway"
},
"codesign": {
"id": "scaleway-cli"
},
"downloads-page": {
"filename": "index.md",
"templateFile": "downloads.tpl"
},
"publish-github": {
"owner": "scaleway",
"prerelease": false,
"repository": "scaleway-cli"
}
},
"ConfigVersion": "0.9",
"BuildSettings": {
"LdFlags": "-s",
"LdFlagsXVars": {
"TimeNow": "main.BUILD_DATE",
"Version": "main.VERSION"
}
}
}
38 changes: 0 additions & 38 deletions Dockerfile

This file was deleted.

42 changes: 30 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,41 @@ $(FMT_LIST): %_fmt:
$(GOFMT) ./$*


cross: pkg/scwversion/version.go
docker build -t $(BUILDER) .
@docker rm scaleway-cli-builer 2>/dev/null || true
mkdir -p dist
docker run --name=$(BUILDER) $(BUILDER) tar -cf - /etc/ssl > dist/ssl.tar
docker cp $(BUILDER):/go/bin tmp
docker rm $(BUILDER)
touch tmp/bin/*
mv tmp/bin/* dist/
rm -rf tmp
release-docker:
docker push scaleway/cli


release-docker:
goxc: pkg/scwversion/version.go
rm -rf dist/$(shell cat .goxc.json| jq -r .PackageVersion)
mkdir -p dist/$(shell cat .goxc.json| jq -r .PackageVersion)
ln -s -f $(shell cat .goxc.json| jq -r .PackageVersion) dist/latest

goxc

mv dist/latest/darwin_386/scw dist/latest/scw-Darwin-i386
mv dist/latest/darwin_amd64/scw dist/latest/scw-Darwin-amd64
mv dist/latest/freebsd_386/scw dist/latest/scw-Freebsd-i386
mv dist/latest/freebsd_amd64/scw dist/latest/scw-Freebsd-x86_64
mv dist/latest/freebsd_arm/scw dist/latest/scw-Freebsd-arm
mv dist/latest/linux_386/scw dist/latest/scw-Linux-i386
mv dist/latest/linux_amd64/scw dist/latest/scw-Linux-x86_64
mv dist/latest/linux_arm/scw dist/latest/scw-Linux-arm
mv dist/latest/netbsd_386/scw dist/latest/scw-Netbsd-i386
mv dist/latest/netbsd_amd64/scw dist/latest/scw-Netbsd-x86_64
mv dist/latest/netbsd_arm/scw dist/latest/scw-Netbsd-arm
mv dist/latest/windows_386/scw.exe dist/latest/scw-Windows-i386.exe
mv dist/latest/windows_amd64/scw.exe dist/latest/scw-Windows-x86_64.exe

cp dist/latest/scw-Linux-arm dist/latest/scw-Linux-armv7l

@rmdir dist/latest/* || true

docker run --rm golang tar -cf - /etc/ssl > dist/latest/ssl.tar
docker build -t scaleway/cli dist
docker run scaleway/cli version
docker tag -f scaleway/cli:latest scaleway/cli:$(TAG)
@echo " Now you can run 'docker push scaleway/cli'"

@echo "Now you can run 'goxc publish-github', 'goxc bintray' and 'make release-docker'"


packages:
Expand Down
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,59 @@ For node version, check out [scaleway-cli-node](https://github.com/moul/scaleway

## Setup

To install Scaleway CLI 1.3.0, run the following commands:
We recommend to use the latest version, using:

```shell
go get -u github.com/scaleway/scaleway-cli/cmd/scw
```

or

```shell
brew install "https://raw.githubusercontent.com/scaleway/scaleway-cli/master/contrib/builder/homebrew/scw.rb" --HEAD
```

---

To install a release, checkout the [latest release page](https://github.com/scaleway/scaleway-cli/releases/latest).

Install the latest stable release on Mac OS X using [Homebrew](http://brew.sh):

```bash
curl -L https://github.com/scaleway/scaleway-cli/releases/download/v1.3.0/scw-`uname -s`-`uname -m` > /usr/local/bin/scw
chmod +x /usr/local/bin/scw
brew install scw
```

To install Scaleway CLI master git, run the following command:
Install the latest stable release on Mac OS X manually:

```bash
go get github.com/scaleway/scaleway-cli/...
# prepare for forst install and upgrade
mkdir -p /usr/local/bin
mv /usr/local/bin/scw /tmp/scw.old

# get latest release
export VERSION=v1.4.0-rc1
wget "https://github.com/scaleway/scaleway-cli/releases/download/${VERSION}/scw_${VERSION}_darwin_amd64.zip" -O /tmp/scw.zip
unzip /tmp/scw.zip \*/scw -d /tmp
mv /tmp/scw_*/scw /usr/local/bin
rm -rf /tmp/scw.zip /tmp/scw_*_darwin_amd64

# test
scw version
```

Install the latest release on Linux:

```bash
# get latest release
export ARCH=amd64 # can be 'i386', 'amd64' or 'arm'
wget "https://github.com/scaleway/scaleway-cli/releases/download/v1.4.0-rc1/scw_v1.4.0-rc1_${ARCH}.deb" -O /tmp/scw.deb
dpkg -i /tmp/scw.deb && rm -f /tmp/scw.deb

# test
scw version
```


### Requirements

By using the [static-compiled release binaries](https://github.com/scaleway/scaleway-cli/releases/latest), you only needs to have one of the following platform+architecture :
Expand Down Expand Up @@ -1056,6 +1096,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address'
* Sorting cache search by Levenshtein distance ([#87](https://github.com/scaleway/scaleway-cli/issues/87))
* Allow set up api endpoint using the environment variable $scaleway_api_endpoint
* Use TLS and verify can now be disabled using `SCALEWAY_TLSVERIFY=0` env var ([#115](https://github.com/scaleway/scaleway-cli/issues/115))
* Switched to `goxc` for releases

#### Fixes

Expand Down
6 changes: 3 additions & 3 deletions contrib/builder/homebrew/scw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
class Scw < Formula
desc "Manage BareMetal Servers from Command Line (as easily as with Docker)"
homepage "https://github.com/scaleway/scaleway-cli"
url "https://github.com/scaleway/scaleway-cli/archive/v1.3.0.tar.gz"
sha256 "b02ed007f831b9ffd79be0b670c6c1bfa59a87ba87ac54dea48005cfb305f5c7"
url "https://github.com/scaleway/scaleway-cli/archive/v1.4.0-rc1.tar.gz"
sha256 "2356191ef6c6e4f541aa2a516ec710f964b914e2976098174f68009d17aa110d"

head "https://github.com/scaleway/scaleway-cli.git"

Expand All @@ -19,7 +19,7 @@ def install
ln_s buildpath, buildpath/"src/github.com/scaleway/scaleway-cli"
Language::Go.stage_deps resources, buildpath/"src"

system "go", "build", "-o", "scw", "."
system "go", "build", "-o", "scw", "./cmd/scw"
bin.install "scw"

bash_completion.install "contrib/completion/bash/scw"
Expand Down
8 changes: 3 additions & 5 deletions dist/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
scw-Darwin-*
scw-Windows-*
scw-Freebsd-*
scw-Linux-arm*
scw-Linux-x86*
*.zip
*.tar.gz
*.deb
Dockerfile
.dockerignore
4 changes: 2 additions & 2 deletions dist/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM scratch
MAINTAINER Scaleway <opensource@scaleway.com> (@scaleway)
ADD ssl.tar /
COPY scw-Linux-i386 /bin/scw
ADD latest/ssl.tar /
COPY latest/scw-Linux-i386 /bin/scw
VOLUME /root/
ENTRYPOINT ["/bin/scw"]
17 changes: 17 additions & 0 deletions downloads.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
layout: default
title: Downloads
---

NOTE: You can get latest version of scaleway-cli using `go get -u github.com/scaleway/scaleway-cli/cmd/scw`.

{{.AppName}} downloads (version {{.Version}})

{{range $k, $v := .Categories}}### {{$k}}

{{range $v}} * [{{.Text}}]({{.RelativeLink}})
{{end}}
{{end}}

---
{{.ExtraVars.footer}}