forked from rancher/norman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rancher#5 from rawmind0/master
Added dapper ci logic to build and release binaries
- Loading branch information
Showing
79 changed files
with
17,440 additions
and
229 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM golang:1.9.4 | ||
RUN apt-get update && \ | ||
apt-get install -y xz-utils zip rsync | ||
RUN go get github.com/rancher/trash | ||
RUN go get golang.org/x/lint/golint | ||
RUN curl -sL https://download.docker.com/linux/static/stable/x86_64/docker-17.03.2-ce.tgz | tar -xzf - && \ | ||
mv docker/docker /usr/bin && rm -rf docker && \ | ||
chmod +x /usr/bin/docker | ||
ENV PATH /go/bin:$PATH | ||
ENV DAPPER_SOURCE /go/src/github.com/rancher/terraform-provider-rancher2 | ||
ENV DAPPER_OUTPUT bin build/bin dist | ||
ENV DAPPER_DOCKER_SOCKET true | ||
ENV DAPPER_ENV TAG REPO GOOS CROSS DRONE_TAG | ||
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache | ||
WORKDIR ${DAPPER_SOURCE} | ||
ENTRYPOINT ["./scripts/entry"] | ||
CMD ["ci"] | ||
|
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
TARGETS := $(shell ls scripts) | ||
|
||
.dapper: | ||
@echo Downloading dapper | ||
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp | ||
@@chmod +x .dapper.tmp | ||
@./.dapper.tmp -v | ||
@mv .dapper.tmp .dapper | ||
|
||
$(TARGETS): .dapper | ||
./.dapper $@ | ||
|
||
trash: .dapper | ||
./.dapper -m bind trash | ||
|
||
trash-keep: .dapper | ||
./.dapper -m bind trash -k | ||
|
||
deps: trash | ||
|
||
.DEFAULT_GOAL := ci | ||
|
||
.PHONY: $(TARGETS) |
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ Terraform Provider for Rancher v2 | |
Features WIP | ||
------------- | ||
|
||
Implemented resources | ||
[Implemented resources](https://github.com/rancher/terraform-provider-rancher2/blob/master/website/docs/r) | ||
|
||
- Catalogs | ||
- Projects | ||
|
@@ -43,61 +43,61 @@ TODO | |
Requirements | ||
------------ | ||
|
||
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x | ||
- [Go](https://golang.org/doc/install) 1.8 (to build the provider plugin) | ||
- [Trash](https://github.com/rancher/trash/releases) 0.2.6 (to manage vendor dependencies) | ||
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x | ||
- [Docker](https://docs.docker.com/install/) to build the provider plugin | ||
- [Trash](https://github.com/rancher/trash/releases) 0.2.6 (to manage vendor dependencies) | ||
|
||
Using the provider | ||
---------------------- | ||
|
||
- Build or download rancher2 provider binary from [relases](https://github.com/rancher/terraform-provider-rancher2/releases) | ||
- Copy rancher2 provider binary to same folder as terraform binary. | ||
- Create tf file and use it. | ||
|
||
```sh | ||
$ terraform init | ||
$ terraform plan | ||
$ terraform apply | ||
``` | ||
|
||
Building The Provider | ||
--------------------- | ||
|
||
Clone repository to: `$GOPATH/src/github.com/rancher/terraform-provider-rancher2` | ||
Clone this repository and run make: | ||
|
||
```sh | ||
$ mkdir -p $GOPATH/src/github.com/rancher; cd $GOPATH/src/github.com/rancher | ||
$ git clone [email protected]:rancher/terraform-provider-rancher2 | ||
$ cd terraform-provider-rancher2 | ||
``` | ||
|
||
Enter the provider directory and build the provider | ||
- Building Linux binary. Released at `bin/` folder | ||
|
||
```sh | ||
$ cd $GOPATH/src/github.com/rancher/terraform-provider-rancher2 | ||
$ make build | ||
$ make | ||
``` | ||
|
||
Using the provider | ||
---------------------- | ||
## Fill in for each provider | ||
- Building linux, osx and windoes binaries. Released at `build/bin/` folder | ||
|
||
```sh | ||
$ CROSS=1 make | ||
``` | ||
|
||
Developing the Provider | ||
--------------------------- | ||
|
||
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.8+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`. | ||
|
||
To compile the provider, run `make build`. This will build the provider and put the provider binary in `$GOPATH/bin/terraform-provider-rancher2` . | ||
To compile the provider, run `make`. This will build the provider and put the provider binary in `bin/terraform-provider-rancher2` . | ||
|
||
To compile binary on repo path and test on terraform: | ||
|
||
```sh | ||
$ make bin | ||
$ make | ||
$ terraform init | ||
$ terraform plan | ||
$ terraform apply | ||
``` | ||
|
||
In order to test the provider, you can simply run `make test`. | ||
|
||
```sh | ||
$ make test | ||
``` | ||
|
||
In order to run the full suite of Acceptance tests, run `make testacc`. | ||
|
||
*Note:* Acceptance tests create real resources, and often cost money to run. | ||
|
||
```sh | ||
$ make testacc | ||
``` | ||
|
||
Managing vendor dependencies | ||
----------------------------- | ||
|
||
|
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,8 @@ | ||
FROM alpine:3.8 | ||
RUN apk add --no-cache ca-certificates openssh-client | ||
RUN wget https://releases.hashicorp.com/terraform/0.11.10/terraform_0.11.10_linux_amd64.zip -O - | unzip -d /usr/bin/ - && \ | ||
chmod 755 /usr/bin/terraform | ||
COPY terraform-provider-rancher2 /usr/bin/ | ||
WORKDIR /mnt | ||
ENTRYPOINT ["terraform"] | ||
CMD ["-help"] |
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
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
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
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
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
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
Oops, something went wrong.