Skip to content

Commit

Permalink
prepare 2.0.29 release (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaunchDarklyCI authored Feb 12, 2020
1 parent 5fa333b commit 2ab1275
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 87 deletions.
174 changes: 141 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,144 @@
# This CircleCI configuration was generated by Releaser for a specific release. It is not to be used
# for regular CI builds. Be aware that rerunning this build may cause it to repeat release actions
# such as publishing to a package manager. However, it will not perform any Git actions other than
# reading the repository.
version: 2.1
workflows:
test:
jobs:
- release_linux
version: 2

# Keep this at the top to reduce noise in chatrooms when we mess up circleci setup
experimental:
notify:
branches:
only:
- master

jobs:
release_linux:
build:
docker:
- image: circleci/node:10-browsers # -browsers image has java but is otherwise relatively small
steps:
- checkout
- run:
name: Install Swagger Codegen
command: |
wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.8/swagger-codegen-cli-2.4.8.jar -O swagger-codegen-cli.jar
printf '#!/bin/bash\nexec java -jar /usr/local/bin/swagger-codegen-cli.jar "$@"\n' > ./swagger-codegen
sudo mv ./swagger-codegen /usr/local/bin
sudo mv ./swagger-codegen-cli.jar /usr/local/bin
sudo chmod +x /usr/local/bin/swagger-codegen
- run:
name: Install pip
command: sudo apt install python-pip

- run:
name: Loading previous client repos
command: |
export REPO_USER_URL=https://github.com/$CIRCLE_PROJECT_USERNAME
make load_prior_targets
- run:
name: Generating code
command: |
export REPO_USER_URL=https://github.com/$CIRCLE_PROJECT_USERNAME
make all
- run:
name: Archiving targets
command: |
cd targets
VERSION=$(cat openapi.json | jq -r '.info.version')
tar cvfz api-clients-${VERSION}-${CIRCLE_SHA1:0:7}.tgz api-client-*
mkdir /tmp/api-clients
cp api-clients-*.tgz /tmp/api-clients
- persist_to_workspace:
root: targets
paths:
- .

- store_artifacts:
path: targets/html2
destination: html

- store_artifacts:
path: targets/html
destination: html-plain

- store_artifacts:
path: /tmp/api-clients

test-go:
docker:
- image: circleci/golang
steps:
- checkout
- attach_workspace:
at: targets
- run: |
mkdir -p /go/src/github.com/launchdarkly
cp -r targets/api-client-go /go/src/github.com/launchdarkly/
- run: |
cd samples/go
make
test-javascript:
docker:
- image: circleci/openjdk:10-node-browsers
environment:
LD_RELEASE_CIRCLECI_TYPE: linux
GRADLE_USER_HOME: "/home/circleci"
LD_RELEASE_BRANCH: "master"
LD_RELEASE_CIRCLECI_BRANCH: ""
LD_RELEASE_DOCS_GITHUB_PAGES: "1"
LD_RELEASE_DOCS_TITLE: ""
LD_RELEASE_PROJECT: "ld-openapi"
LD_RELEASE_PROJECT_TEMPLATE: ""
LD_RELEASE_VERSION: "2.0.28"
- image: circleci/node
steps:
- checkout
- run:
name: "Releaser: prepare"
command: .ldrelease/circleci/mac/execute.sh prepare .ldrelease/prepare.sh
- run:
name: "Releaser: build"
command: .ldrelease/circleci/mac/execute.sh build .ldrelease/build.sh
- run:
name: "Releaser: publish"
command: .ldrelease/circleci/mac/execute.sh publish .ldrelease/publish.sh
- store_artifacts:
path: artifacts
- checkout
- attach_workspace:
at: targets
- run: |
cd samples/javascript
sudo npm link ../../targets/api-client-javascript
node index.js
test-python:
docker:
- image: circleci/python:3.7
steps:
- checkout
- attach_workspace:
at: targets
- run: |
cd samples/python
sudo pip install -e ../../targets/api-client-python
python main.py
test-ruby:
docker:
- image: circleci/ruby
steps:
- checkout
- attach_workspace:
at: targets
- run:
name: Install Gem
command: |
cd targets/api-client-ruby
gem build launchdarkly_api.gemspec
gem install ./launchdarkly_api*.gem
- run: |
cd samples/ruby
ruby main.rb
workflows:
version: 2
build:
jobs:
- build:
filters:
branches:
ignore:
- gh-pages
tags:
only:
/.*/ # Required in order to run publish job for a tag push
- test-go:
requires:
- build
- test-javascript:
requires:
- build
- test-python:
requires:
- build
- test-ruby:
requires:
- build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ node_modules

# Built clients and servers
targets/
client-clones/

# Auto generated files
.DS_Store
Expand Down
15 changes: 0 additions & 15 deletions .ldrelease/circleci/linux/execute.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .ldrelease/circleci/mac/execute.sh

This file was deleted.

16 changes: 0 additions & 16 deletions .ldrelease/circleci/windows/execute.ps1

This file was deleted.

32 changes: 24 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ DOC_TARGETS = \
API_CLIENT_PREFIX = api-client

TARGETS_PATH ?= ./targets
CLIENT_CLONES_PATH ?= ./client-clones
TEMPLATES_PATH ?= ./swagger-codegen-templates
SAMPLES_PATH ?= ./samples

Expand Down Expand Up @@ -150,18 +151,32 @@ push_test: push

push_dry_run: GIT_PUSH_COMMAND=git push --dry-run
push:
cd $(TARGETS_PATH); \
$(GIT_COMMAND) submodule foreach git add .; \
$(GIT_COMMAND) submodule foreach git commit --allow-empty -m "Version $(VERSION) automatically generated from $(REPO)@$(REVISION)."; \
mkdir $(CLIENT_CLONES_PATH); \
cd $(CLIENT_CLONES_PATH); \
$(foreach RELEASE_TARGET, $(RELEASE_TARGETS), \
echo Publishing updates to the $(RELEASE_TARGET) client repository...; \
git -C ./api-client-$(RELEASE_TARGET) tag $(TAG); \
git -C ./api-client-$(RELEASE_TARGET) push origin $(TAG); \
git -C ./api-client-$(RELEASE_TARGET) push origin $(RELEASE_BRANCH); \
echo Publishing updates to the $(RELEASE_TARGET) client repository...; \
$(GIT_COMMAND) clone git@github.com:launchdarkly/api-client-$(RELEASE_TARGET).git; \
cd api-client-$(RELEASE_TARGET); \
cp -r ../../$(TARGETS_PATH)/api-client-$(RELEASE_TARGET) .; \
$(GIT_COMMAND) add .; \
$(GIT_COMMAND) commit --allow-empty -m "Version $(VERSION) automatically generated from $(REPO)@$(REVISION)."; \
$(GIT_COMMAND) tag $(TAG); \
$(GIT_PUSH_COMMAND) origin $(TAG); \
$(GIT_PUSH_COMMAND) origin $(RELEASE_BRANCH); \
cd ..; \
) \
if [ $(PREV_RELEASE_BRANCH) == "master" ]; then \
git -C ./gh-pages push; \
echo Publishing updates to GitHub pages...; \
$(GIT_COMMAND) clone git@github.com:launchdarkly/$(REPO).git; \
cd $(REPO); \
$(GIT_COMMAND) checkout gh-pages --; \
cp -r ../../$(TARGETS_PATH)/gh-pages .; \
$(GIT_COMMAND) add .; \
$(GIT_COMMAND) commit --allow-empty -m "Version $(VERSION) automatically generated from $(REPO)@$(REVISION)."; \
$(GIT_PUSH_COMMAND) origin gh-pages; \
cd ..; \
fi

publish:
$(foreach TARGET, $(PUBLISH_TARGETS), \
echo Publishing client artifacts for $(TARGET)...; \
Expand All @@ -173,5 +188,6 @@ $(SWAGGER_JAR):

clean:
rm -rf $(TARGETS_PATH)
rm -rf $(CLIENT_CLONES_PATH)

.PHONY: $(TARGETS) all clean gh-pages load_prior_targets openapi_yaml push push_dry_run push_test

0 comments on commit 2ab1275

Please sign in to comment.