Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Jan 12, 2024
1 parent 48798a9 commit cae1c91
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 33 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
setup:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic_base
volumes: [./:/app]
image: ghcr.io/algolia/apic-base
volumes:
- ./:/app
timeout-minutes: 10
steps:
- name: debugging - dump GitHub context
Expand Down Expand Up @@ -105,8 +106,9 @@ jobs:
scripts:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic_base
volumes: [./:/app]
image: ghcr.io/algolia/apic-base
volumes:
- ./:/app
timeout-minutes: 10
needs: setup
if: ${{ needs.setup.outputs.RUN_SCRIPTS == 'true' }}
Expand All @@ -128,8 +130,9 @@ jobs:
specs:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic_base
volumes: [./:/app]
image: ghcr.io/algolia/apic-base
volumes:
- ./:/app
timeout-minutes: 10
needs: setup
steps:
Expand Down Expand Up @@ -161,8 +164,9 @@ jobs:
timeout-minutes: 10
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic_base
volumes: [./:/app]
image: ghcr.io/algolia/apic-base
volumes:
- ./:/app
needs: setup
if: ${{ needs.setup.outputs.RUN_GEN_JAVASCRIPT == 'true' }}
strategy:
Expand Down Expand Up @@ -209,8 +213,9 @@ jobs:
timeout-minutes: 10
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic_base
volumes: [./:/app]
image: ghcr.io/algolia/apic-base
volumes:
- ./:/app
needs:
- setup
- client_javascript_utils
Expand Down Expand Up @@ -319,7 +324,8 @@ jobs:
runs-on: 'ubuntu-22.04'
container:
image: ${{ format('ghcr.io/algolia/{0}', matrix.client.dockerImage }}
volumes: [./:/app]
volumes:
- ./:/app
needs:
- setup
- specs
Expand Down Expand Up @@ -399,8 +405,9 @@ jobs:
codegen:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic_base
volumes: [./:/app]
image: ghcr.io/algolia/apic-base
volumes:
- ./:/app
timeout-minutes: 10
needs:
- setup
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ jobs:
notification:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic_base
volumes: [./:/app]
image: ghcr.io/algolia/apic-base
volumes:
- ./:/app
timeout-minutes: 10
if: (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.number
steps:
Expand All @@ -31,8 +32,9 @@ jobs:
cleanup:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic_base
volumes: [./:/app]
image: ghcr.io/algolia/apic-base
volumes:
- ./:/app
timeout-minutes: 10
if: github.event.action == 'closed'
steps:
Expand Down
22 changes: 11 additions & 11 deletions config/clients.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"packageVersion": "7.0.0-alpha.3",
"modelFolder": "algoliasearch",
"apiFolder": "algoliasearch",
"dockerImage": "apic_base",
"dockerImage": "apic-base",
"tests": {
"extension": ".test.cs",
"outputFolder": "src/tests"
Expand Down Expand Up @@ -46,7 +46,7 @@
"packageVersion": "1.3.0",
"modelFolder": "lib/src/model",
"apiFolder": "lib/src/api",
"dockerImage": "apic_base",
"dockerImage": "apic-base",
"tests": {
"extension": "_test.dart",
"outputFolder": "test"
Expand All @@ -69,7 +69,7 @@
"packageVersion": "4.0.0-alpha.41",
"modelFolder": "algolia",
"apiFolder": "algolia",
"dockerImage": "apic_base",
"dockerImage": "apic-base",
"tests": {
"extension": "_test.go",
"outputFolder": "tests"
Expand All @@ -92,7 +92,7 @@
"packageVersion": "4.0.0-beta.16",
"modelFolder": "algoliasearch/src/main/java/com/algolia/model",
"apiFolder": "algoliasearch/src/main/java/com/algolia/api",
"dockerImage": "apic_base",
"dockerImage": "apic-base",
"tests": {
"extension": ".test.java",
"outputFolder": "src/test/java/com/algolia"
Expand Down Expand Up @@ -151,7 +151,7 @@
"packageVersion": "5.0.0-alpha.97",
"modelFolder": "model",
"apiFolder": "src",
"dockerImage": "apic_base",
"dockerImage": "apic-base",
"tests": {
"extension": ".test.ts",
"outputFolder": "src"
Expand All @@ -178,7 +178,7 @@
"packageVersion": "3.0.0-beta.10",
"modelFolder": "client/src/commonMain/kotlin/com/algolia/client/model",
"apiFolder": "client/src/commonMain/kotlin/com/algolia/client/api",
"dockerImage": "apic_base",
"dockerImage": "apic-base",
"tests": {
"extension": "Test.kt",
"outputFolder": "src/commonTest/kotlin/com/algolia"
Expand All @@ -201,7 +201,7 @@
"packageVersion": "4.0.0-alpha.91",
"modelFolder": "lib/Model",
"apiFolder": "lib/Api",
"dockerImage": "apic_base",
"dockerImage": "apic-base",
"tests": {
"extension": "Test.php",
"outputFolder": "src"
Expand All @@ -228,7 +228,7 @@
"packageVersion": "4.0.0b1",
"modelFolder": "algoliasearch",
"apiFolder": "algoliasearch",
"dockerImage": "apic_base",
"dockerImage": "apic-base",
"tests": {
"extension": "_test.py",
"outputFolder": "tests"
Expand All @@ -255,7 +255,7 @@
"packageVersion": "3.0.0.alpha.4",
"modelFolder": "lib/algolia/models",
"apiFolder": "lib/algolia/api",
"dockerImage": "apic_ruby",
"dockerImage": "apic-ruby",
"tests": {
"extension": "_test.rb",
"outputFolder": "test"
Expand All @@ -278,7 +278,7 @@
"packageVersion": "2.0.0-alpha.4",
"modelFolder": "src/main/scala/algoliasearch",
"apiFolder": "src/main/scala/algoliasearch/api",
"dockerImage": "apic_base",
"dockerImage": "apic-base",
"tests": {
"extension": "Test.scala",
"outputFolder": "src/test/scala/algoliasearch"
Expand All @@ -301,7 +301,7 @@
"packageVersion": "9.0.0-alpha.0",
"modelFolder": "Sources",
"apiFolder": "Sources",
"dockerImage": "apic_swift",
"dockerImage": "apic-swift",
"tests": {
"extension": ".swift",
"outputFolder": "Tests"
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
base:
container_name: apic_base
container_name: apic-base
build:
context: .
dockerfile: scripts/docker/Dockerfile.base
Expand All @@ -15,7 +15,7 @@ services:
command: tail -f /dev/null
volumes: [./:/app]
ruby:
container_name: apic_ruby
container_name: apic-ruby
build:
context: .
dockerfile: scripts/docker/Dockerfile.ruby
Expand All @@ -26,7 +26,7 @@ services:
command: tail -f /dev/null
volumes: [./:/app]
swift:
container_name: apic_swift
container_name: apic-swift
build:
context: .
dockerfile: scripts/docker/Dockerfile.swift
Expand Down
4 changes: 4 additions & 0 deletions scripts/docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ COPY --from=csharp-builder /usr/share/dotnet /usr/share/dotnet
RUN echo "export PATH=$PATH:/usr/share/dotnet" >> ~/.profile && source ~/.profile

WORKDIR /app

# Autolink repository https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package
LABEL org.opencontainers.image.source=https://github.com/algolia/api-clients-automation
LABEL org.opencontainers.image.revision=latest
4 changes: 4 additions & 0 deletions scripts/docker/Dockerfile.ruby
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | b
&& nvm alias default ${NODE_VERSION} \
&& nvm use default \
&& npm install -g yarn

# Autolink repository https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package
LABEL org.opencontainers.image.source=https://github.com/algolia/api-clients-automation
LABEL org.opencontainers.image.revision=latest
4 changes: 4 additions & 0 deletions scripts/docker/Dockerfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ RUN git clone --depth 1 -b release/${SWIFT_VERSION} https://github.com/apple/swi
&& cd /tmp/swift-format && swift build -c release \
&& mv .build/release/swift-format /usr/bin \
&& cd /app && rm -rf /tmp/swift-format

# Autolink repository https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package
LABEL org.opencontainers.image.source=https://github.com/algolia/api-clients-automation
LABEL org.opencontainers.image.revision=latest
16 changes: 16 additions & 0 deletions scripts/docker/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/bash

export NODE_VERSION=$(cat .nvmrc)
find config -name '.*-version' | xargs -I{} sh -c 'l=$(echo "{}" | sed -e "s/-/_/;s/config\/\.//" | tr "[a-z]" "[A-Z]");echo "export $l=$(cat {})"'

docker buildx build --load \
--platform linux/amd64 \
--build-arg CSHARP_VERSION \
--build-arg DART_VERSION \
--build-arg GO_VERSION \
--build-arg JAVA_VERSION \
--build-arg NODE_VERSION \
--build-arg PHP_VERSION \
--build-arg PYTHON_VERSION \
-t ghcr.io/algolia/apic-base:latest \
-f scripts/docker/Dockerfile.base .
4 changes: 2 additions & 2 deletions website/docs/contributing/add-new-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ You can pick a default template on the [openapi-generator's "generators" page](h
### Extract the template locally

```bash
docker exec apic_base bash -c "yarn openapi-generator-cli author template -g <templateName> -o templates/<languageName>"
docker exec apic-base bash -c "yarn openapi-generator-cli author template -g <templateName> -o templates/<languageName>"
```

Example for the `JavaScript` client with the `typescript-node` template:

```bash
docker exec apic_base bash -c "yarn openapi-generator-cli author template -g typescript-node -o templates/javascript/"
docker exec apic-base bash -c "yarn openapi-generator-cli author template -g typescript-node -o templates/javascript/"
```

## Update the generator config
Expand Down

0 comments on commit cae1c91

Please sign in to comment.