Skip to content

Commit 7956e6d

Browse files
authored
Merge branch 'master' into bug1489608
2 parents d45a160 + 815cb35 commit 7956e6d

File tree

12 files changed

+974
-41
lines changed

12 files changed

+974
-41
lines changed

.taskcluster.yml

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ tasks:
4848
- /bin/bash
4949
- '--login'
5050
- '-cx'
51-
- >-
52-
git clone {{event.head.repo.url}} repo &&
53-
cd repo &&
54-
git config advice.detachedHead false &&
55-
git checkout {{event.head.sha}} &&
56-
export DEBUG=* DOCS_PROJECT=taskcluster-lib-urls DOCS_TIER=libraries DOCS_FOLDER=docs DOCS_README=README.md &&
51+
- |
52+
git clone {{event.head.repo.url}} repo
53+
cd repo
54+
git config advice.detachedHead false
55+
git checkout {{event.head.sha}}
56+
export DEBUG=* DOCS_PROJECT=taskcluster-lib-urls DOCS_TIER=libraries DOCS_FOLDER=docs DOCS_README=README.md
5757
upload-project-docs
5858
metadata:
5959
name: "taskcluster-lib-urls docs upload"
@@ -75,22 +75,48 @@ tasks:
7575
command:
7676
- /bin/bash
7777
- '-c'
78-
- >-
79-
mkdir -p /go/src/github.com/taskcluster/taskcluster-lib-urls &&
80-
cd /go/src/github.com/taskcluster/taskcluster-lib-urls &&
81-
git clone {{event.head.repo.url}} . &&
82-
git config advice.detachedHead false &&
83-
git checkout {{event.head.sha}} &&
84-
go get -v -d -t ./... &&
85-
go test -v -race ./... &&
86-
go get -u github.com/alecthomas/gometalinter &&
87-
gometalinter --install &&
78+
- |
79+
mkdir -p /go/src/github.com/taskcluster/taskcluster-lib-urls
80+
cd /go/src/github.com/taskcluster/taskcluster-lib-urls
81+
git clone {{event.head.repo.url}} .
82+
git config advice.detachedHead false
83+
git checkout {{event.head.sha}}
84+
go get -v -d -t ./...
85+
go test -v -race ./...
86+
go get -u github.com/alecthomas/gometalinter
87+
gometalinter --install
8888
gometalinter
8989
metadata:
9090
name: "taskcluster-lib-urls go test"
9191
description: Run library test suite - golang 1.10
9292
owner: '{{ event.head.user.email }}'
9393
source: '{{ event.head.repo.url }}'
94+
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
95+
workerType: '{{ taskcluster.docker.workerType }}'
96+
extra:
97+
github:
98+
events:
99+
- pull_request.opened
100+
- pull_request.synchronize
101+
- pull_request.reopened
102+
- push
103+
payload:
104+
maxRunTime: 3600
105+
image: 'maven'
106+
command:
107+
- /bin/bash
108+
- '-c'
109+
- |
110+
git clone {{event.head.repo.url}} repo
111+
cd repo
112+
git config advice.detachedHead false
113+
git checkout {{event.head.sha}}
114+
mvn install
115+
metadata:
116+
name: taskcluster-lib-urls java test
117+
description: Run library test suite - java
118+
owner: '{{ event.head.user.email }}'
119+
source: '{{ event.head.repo.url }}'
94120
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
95121
workerType: '{{ taskcluster.docker.workerType }}'
96122
extra:
@@ -106,12 +132,12 @@ tasks:
106132
command:
107133
- /bin/bash
108134
- '-c'
109-
- >-
110-
git clone {{event.head.repo.url}} repo &&
111-
cd repo &&
112-
git config advice.detachedHead false &&
113-
git checkout {{event.head.sha}} &&
114-
pip install tox &&
135+
- |
136+
git clone {{event.head.repo.url}} repo
137+
cd repo
138+
git config advice.detachedHead false
139+
git checkout {{event.head.sha}}
140+
pip install tox
115141
tox -e py27
116142
metadata:
117143
name: "taskcluster-lib-urls python 2.7 test"
@@ -133,12 +159,12 @@ tasks:
133159
command:
134160
- /bin/bash
135161
- '-c'
136-
- >-
137-
git clone {{event.head.repo.url}} repo &&
138-
cd repo &&
139-
git config advice.detachedHead false &&
140-
git checkout {{event.head.sha}} &&
141-
pip install tox &&
162+
- |
163+
git clone {{event.head.repo.url}} repo
164+
cd repo
165+
git config advice.detachedHead false
166+
git checkout {{event.head.sha}}
167+
pip install tox
142168
tox -e py36
143169
metadata:
144170
name: taskcluster-lib-urls python 3.6 test

README.md

Lines changed: 94 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Taskcluster URL Building Library
22

3-
[![Build Status](https://travis-ci.org/taskcluster/taskcluster-lib-urls.svg?branch=master)](https://travis-ci.org/taskcluster/taskcluster-lib-urls)
4-
[![npm](https://img.shields.io/npm/v/taskcluster-lib-urls.svg?maxAge=2592000)](https://www.npmjs.com/package/taskcluster-lib-urls)
53
[![License](https://img.shields.io/badge/license-MPL%202.0-orange.svg)](http://mozilla.org/MPL/2.0)
64

75
A simple library to generate URLs for various Taskcluster resources across our various deployment methods.
@@ -21,7 +19,9 @@ Requirements
2119
This is tested on and should run on any of Node.js `{8, 10}`.
2220

2321
JS Usage
24-
-----
22+
--------
23+
[![Node.js Build Status](https://travis-ci.org/taskcluster/taskcluster-lib-urls.svg?branch=master)](https://travis-ci.org/taskcluster/taskcluster-lib-urls)
24+
[![npm](https://img.shields.io/npm/v/taskcluster-lib-urls.svg?maxAge=2592000)](https://www.npmjs.com/package/taskcluster-lib-urls)
2525

2626
This package exports several methods for generating URLs conditionally based on
2727
a root URL, as well as a few helper classes for generating URLs for a pre-determined
@@ -81,9 +81,19 @@ If you would like, you can set this up via [taskcluster-lib-loader](https://gith
8181
}
8282
```
8383

84+
Test with:
85+
86+
```
87+
yarn install
88+
yarn test
89+
```
90+
91+
8492
Go Usage
8593
--------
8694

95+
[![GoDoc](https://godoc.org/github.com/taskcluster/taskcluster-lib-urls?status.svg)](https://godoc.org/github.com/taskcluster/taskcluster-lib-urls)
96+
8797
The go package exports the following functions:
8898

8999
```go
@@ -96,8 +106,20 @@ func UI(rootURL string, path string) string
96106
func ServicesManifest(rootURL string) string
97107
```
98108

109+
Install with:
110+
111+
```
112+
go install ./..
113+
```
114+
115+
Test with:
116+
117+
```
118+
go test -v ./...
119+
```
120+
99121
Python Usage
100-
--------
122+
------------
101123

102124
You can install the python client with `pip install taskcluster-urls`;
103125

@@ -113,22 +135,79 @@ taskcluster_urls.servicesManifest(root_url)
113135
taskcluster_urls.docs(root_url, 'foo/bar')
114136
```
115137

116-
Testing
117-
-------
138+
Test with:
118139

119-
`yarn install` and `yarn test`.
140+
```
141+
tox
142+
```
120143

121-
Hacking
122-
-------
144+
Java Usage
145+
----------
123146

124-
New releases should be tested on Travis to allow for all supported versions of Node to be tested. Once satisfied that it works, new versions should be created with
125-
`yarn version` rather than by manually editing `package.json` and tags should be pushed to Github. Make sure to update [the changelog](https://github.com/taskcluster/taskcluster-lib-urls/releases)!
147+
[![JavaDoc](https://img.shields.io/badge/javadoc-reference-blue.svg)](http://taskcluster.github.io/taskcluster-lib-urls/apidocs)
126148

127-
## Releasing
149+
In order to use this library from your maven project, simply include it as a project dependency:
128150

129-
Make the Node release first, as Python's version depends on its `package.json`. This follows the typical tag-and-push-to-publish approach:
151+
```
152+
<project>
153+
...
154+
<dependencies>
155+
...
156+
<dependency>
157+
<groupId>org.mozilla.taskcluster</groupId>
158+
<artifactId>taskcluster-lib-urls</artifactId>
159+
<version>1.0.0</version>
160+
</dependency>
161+
</dependencies>
162+
</project>
163+
```
164+
165+
The taskcluster-lib-urls artifacts are now available from the [maven central repository](http://central.sonatype.org/):
166+
167+
* [Search Results](http://search.maven.org/#search|gav|1|g%3A%22org.mozilla.taskcluster%22%20AND%20a%3A%22taskcluster-lib-urls%22)
168+
* [Directory Listing](https://repo1.maven.org/maven2/org/mozilla/taskcluster/taskcluster-lib-urls/)
169+
170+
To use the library, do as follows:
171+
172+
```java
173+
import org.mozilla.taskcluster.urls.*;
174+
175+
...
176+
177+
URLProvider urlProvider = URLs.provider("https://mytaskcluster.acme.org");
178+
179+
String fooBarAPI = urlProvider.api("auth", "v1", "foo/bar");
180+
String fooSchema = urlProvider.schema("auth", "v1/foo.yml"); // Note that schema names have versions in them
181+
String authAPIRef = urlProvider.apiReference("auth", "v1");
182+
String authExchangesRef = urlProvider.exchangeReference("auth", "v1");
183+
String uiFooBar = urlProvider.ui("foo/bar");
184+
String servicesManifest = urlProvider.servicesManifest();
185+
String docsFooBar = urlProvider.docs("foo/bar");
186+
187+
...
188+
```
189+
190+
Install with:
191+
192+
```
193+
mvn install
194+
```
195+
196+
Test with:
197+
198+
```
199+
mvn test
200+
```
130201

131202

203+
Releasing
204+
---------
205+
206+
New releases should be tested on Travis and Taskcluster to allow for all supported versions of various languages to be tested. Once satisfied that it works, new versions should be created with
207+
`npm version` rather than by manually editing `package.json` and tags should be pushed to Github.
208+
209+
Make the Node release first, as Python's version depends on its `package.json`. This follows the typical tag-and-push-to-publish approach:
210+
132211
```sh
133212
$ npm version minor # or patch, or major
134213
$ git push upstream
@@ -144,6 +223,8 @@ pip install twine
144223
twine upload dist/*
145224
```
146225
226+
Make sure to update [the changelog](https://github.com/taskcluster/taskcluster-lib-urls/releases)!
227+
147228
License
148229
-------
149230

0 commit comments

Comments
 (0)