Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Commit

Permalink
Refactor artman user config (#389)
Browse files Browse the repository at this point in the history
Improve the artman usability by a) removing artman user config fields that are no longer necessary, b) proto-fy artman user config and c) making artman user config (~/.artman/config.yaml) optional.

Context:
Artman user config was originally introduced in artman PR#159. The PR largely improved the usability of artman at that time, and many fields were named to be consistent with artman CLI by that time (e.g. reporoot). Another refactoring (PR#254) was made towards artman config (not user config) and artman CLI in Aug 2017, which made some existing artman user config fields no longer necessary.
  • Loading branch information
ethanbao authored Feb 16, 2018
1 parent cd2c7cf commit e946c69
Show file tree
Hide file tree
Showing 25 changed files with 538 additions and 467 deletions.
66 changes: 34 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ jobs:
docker:
- image: docker:17.05.0-ce-git
steps:
- checkout
- &checkout_artman
checkout:
path: /usr/src/artman/
- setup_remote_docker
- &restore_artman_cache
restore_cache:
Expand Down Expand Up @@ -58,7 +60,7 @@ jobs:
docker:
- image: docker:17.05.0-ce-git
steps:
- checkout
- *checkout_artman
- setup_remote_docker
- *restore_artman_cache
- *load_build_and_save_artman_image
Expand All @@ -81,13 +83,14 @@ jobs:
docker:
- image: python:3.6
steps:
- checkout
- *checkout_artman
- run:
name: Install nox.
command: pip install --upgrade nox-automation
- run:
name: Build the docs.
command: nox -e docs
working_directory: /usr/src/artman/

unit-python2.7:
docker:
Expand All @@ -106,7 +109,7 @@ jobs:
docker:
- image: python:3.4
steps:
- checkout
- *checkout_artman
- run:
name: Install nox and codecov.
command: pip install --upgrade nox-automation codecov
Expand All @@ -119,7 +122,7 @@ jobs:
docker:
- image: python:3.5
steps:
- checkout
- *checkout_artman
- run:
name: Install nox and codecov.
command: pip install --upgrade nox-automation codecov
Expand All @@ -141,14 +144,13 @@ jobs:
command: nox -e "unit_tests(python_version='3.6')"
working_directory: /usr/src/artman/


smoke-csharp:
docker:
- image: googleapis/artman:latest
environment:
TERM: dumb
steps:
- checkout
- *checkout_artman
- run:
name: Install latest artman
command: |
Expand All @@ -160,15 +162,15 @@ jobs:
- run:
name: Build Speech (C#)
command: artman --local --config=google/cloud/speech/artman_speech_v1.yaml --root-dir=/googleapis generate csharp_gapic
working_directory: /usr/src/artman/
working_directory: /usr/src/artman/ # Intended, in order to test --root-dir flag.

smoke-go:
docker:
- image: googleapis/artman:latest
environment:
TERM: dumb
steps:
- checkout
- *checkout_artman
- run:
name: Install latest artman
command: |
Expand All @@ -178,21 +180,21 @@ jobs:
name: Build Pub/Sub (Go)
command: |
mkdir /tmp/pubsub-go
artman --local --output-dir /tmp/pubsub-go --config=/googleapis/google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging go_gapic
artman --local --output-dir /tmp/pubsub-go --config=google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging go_gapic
- run:
name: Build Speech (Go)
command: |
mkdir /tmp/speech-go
artman --local --output-dir /tmp/speech-go --config=/googleapis/google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging go_gapic
working_directory: /usr/src/artman/
artman --local --output-dir /tmp/speech-go --config=google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging go_gapic
working_directory: /googleapis

smoke-java:
docker:
- image: googleapis/artman:latest
environment:
TERM: dumb
steps:
- checkout
- *checkout_artman
- run:
name: Install latest artman
command: |
Expand All @@ -202,21 +204,21 @@ jobs:
name: Build Pub/Sub (Java)
command: |
git clone https://github.com/googleapis/api-client-staging /tmp/api-client-staging
artman --local --config=/googleapis/google/pubsub/artman_pubsub.yaml publish --dry-run --local-repo-dir=/tmp/api-client-staging --github-username foo --github-token bar --target staging java_gapic
artman --local --config=google/pubsub/artman_pubsub.yaml publish --dry-run --local-repo-dir=/tmp/api-client-staging --github-username foo --github-token bar --target staging java_gapic
- run:
name: Build Speech (Java)
command: |
mkdir /tmp/speech-java
artman --local --output-dir /tmp/speech-java --config=/googleapis/google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging java_gapic
working_directory: /usr/src/artman/
artman --local --output-dir /tmp/speech-java --config=google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging java_gapic
working_directory: /googleapis

smoke-nodejs:
docker:
- image: googleapis/artman:latest
environment:
TERM: dumb
steps:
- checkout
- *checkout_artman
- run:
name: Install latest artman
command: |
Expand All @@ -226,21 +228,21 @@ jobs:
name: Build Pub/Sub (Node.js)
command: |
mkdir /tmp/pubsub-node
artman --local --output-dir /tmp/pubsub-node --config=/googleapis/google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging nodejs_gapic
artman --local --output-dir /tmp/pubsub-node --config=google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging nodejs_gapic
- run:
name: Build Speech (Node.js)
command: |
mkdir /tmp/speech-node
artman --local --output-dir speech-node --config=/googleapis/google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging nodejs_gapic
working_directory: /usr/src/artman/
artman --local --output-dir speech-node --config=google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging nodejs_gapic
working_directory: /googleapis

smoke-php:
docker:
- image: googleapis/artman:latest
environment:
TERM: dumb
steps:
- checkout
- *checkout_artman
- run:
name: Install latest artman
command: |
Expand All @@ -250,21 +252,21 @@ jobs:
name: Build Pub/Sub (PHP)
command: |
mkdir /tmp/pubsub-php
artman --local --output-dir /tmp/pubsub-php --config=/googleapis/google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging php_gapic
artman --local --output-dir /tmp/pubsub-php --config=google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging php_gapic
- run:
name: Build Speech (PHP)
command: |
mkdir /tmp/speech-php
artman --local --output-dir /tmp/speech-php --config=/googleapis/google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging php_gapic
working_directory: /usr/src/artman/
artman --local --output-dir /tmp/speech-php --config=google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging php_gapic
working_directory: /googleapis

smoke-python:
docker:
- image: googleapis/artman:latest
environment:
TERM: dumb
steps:
- checkout
- *checkout_artman
- run:
name: Install latest artman
command: |
Expand All @@ -274,21 +276,21 @@ jobs:
name: Build Pub/Sub (Python)
command: |
mkdir /tmp/pubsub-python
artman --local --output-dir /tmp/pubsub-python --config=/googleapis/google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging python_gapic
artman --local --output-dir /tmp/pubsub-python --config=google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging python_gapic
- run:
name: Build Speech (Python)
command: |
mkdir /tmp/speech-python
artman --local --output-dir /tmp/speech-python --config=/googleapis/google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging python_gapic
working_directory: /usr/src/artman/
artman --local --output-dir /tmp/speech-python --config=google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging python_gapic
working_directory: /googleapis

smoke-ruby:
docker:
- image: googleapis/artman:latest
environment:
TERM: dumb
steps:
- checkout
- *checkout_artman
- run:
name: Install latest artman
command: |
Expand All @@ -298,13 +300,13 @@ jobs:
name: Build Pub/Sub (Ruby)
command: |
mkdir /tmp/pubsub-ruby
artman --local --output-dir /tmp/pubsub-ruby --config=/googleapis/google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging ruby_gapic
artman --local --output-dir /tmp/pubsub-ruby --config=google/pubsub/artman_pubsub.yaml publish --dry-run --github-username foo --github-token bar --target staging ruby_gapic
- run:
name: Build Speech (Ruby)
command: |
mkdir /tmp/speech-ruby
artman --local --output-dir /tmp/speech-ruby --config=/googleapis/google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging ruby_gapic
working_directory: /usr/src/artman/
artman --local --output-dir /tmp/speech-ruby --config=google/cloud/speech/artman_speech_v1.yaml publish --dry-run --github-username foo --github-token bar --target staging ruby_gapic
working_directory: /googleapis

workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ RUN curl -SL $DOTNET_SDK_DOWNLOAD_URL --output dotnet.tar.gz \
# Install couple of git repos
RUN git clone https://github.com/googleapis/googleapis \
&& cd googleapis \
&& git checkout 6cb47db389b1670310a8d323658eb3d7148f7da1 \
&& git checkout 4568cba600c72347542d7fa9c826c25584ef55a6 \
&& cd .. \
&& rm -rf /googleapis/.git/
RUN git clone https://github.com/googleapis/toolkit \
Expand Down
5 changes: 2 additions & 3 deletions artman-user-config-in-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
local_paths:
reporoot: /
publish: noop
local:
toolkit: /toolkit
Loading

0 comments on commit e946c69

Please sign in to comment.