ci: always use makefile

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-16 22:57:02 +02:00
parent f9ce41229d
commit 626006725e
6 changed files with 15 additions and 71 deletions

View File

@ -30,7 +30,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: prepare ts api client
run: |
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli generate -i /local/schema.yml -g typescript-fetch -o /local/web/api --additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=authentik-api,npmVersion=1.0.0
make gen-web
- name: Building Docker Image
uses: docker/build-push-action@v2
with:
@ -51,18 +51,8 @@ jobs:
go-version: "^1.15"
- name: prepare go api client
run: |
make gen-outpost
cd outpost
cp ../schema.yml .
docker run \
--rm -v $(pwd):/local \
openapitools/openapi-generator-cli generate \
--git-host goauthentik.io \
--git-repo-id outpost \
--git-user-id api \
-i /local/schema.yml \
-g go \
-o /local/api \
--additional-properties=packageName=api,enumClassPrefix=true
go build -v ./cmd/proxy/server.go
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.1.0
@ -100,18 +90,8 @@ jobs:
go-version: "^1.15"
- name: prepare go api client
run: |
make gen-outpost
cd outpost
cp ../schema.yml .
docker run \
--rm -v $(pwd):/local \
openapitools/openapi-generator-cli generate \
--git-host goauthentik.io \
--git-repo-id outpost \
--git-user-id api \
-i /local/schema.yml \
-g go \
-o /local/api \
--additional-properties=packageName=api,enumClassPrefix=true
go build -v ./cmd/ldap/server.go
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.1.0

View File

@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- name: prepare ts api client
run: |
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli generate -i /local/schema.yml -g typescript-fetch -o /local/web/api --additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=authentik-api,npmVersion=1.0.0
make gen-web
- name: Pre-release test
run: |
sudo apt-get install -y pwgen

View File

@ -298,7 +298,7 @@ stages:
displayName: Build static files for e2e
inputs:
script: |
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli generate -i /local/schema.yml -g typescript-fetch -o /local/web/api --additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=authentik-api,npmVersion=1.0.0
make gen-web
sudo chmod 777 -R web/api/
cd web
cd api && npm i && cd ..
@ -386,36 +386,19 @@ stages:
- task: CmdLine@2
inputs:
script: bash <(curl -s https://codecov.io/bash)
- stage: generate
jobs:
- job: swagger_generate
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- task: CmdLine@2
inputs:
script: |
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli generate -i /local/schema.yml -g typescript-fetch -o /local/web/api --additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=authentik-api,npmVersion=1.0.0
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'web/api/'
artifact: 'ts_swagger_client'
publishLocation: 'pipeline'
- stage: Build
jobs:
- job: build_server
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DownloadPipelineArtifact@2
- task: NodeTool@0
inputs:
buildType: 'current'
artifactName: 'ts_swagger_client'
path: "web/api/"
versionSpec: '16.x'
displayName: 'Install Node.js'
- task: CmdLine@2
inputs:
script: make gen-web
- task: Bash@3
inputs:
targetType: 'inline'

View File

@ -24,19 +24,7 @@ stages:
version: '1.16.3'
- task: CmdLine@2
inputs:
script: |
cp ../schema.yml .
docker run \
--rm -v $(pwd):/local \
openapitools/openapi-generator-cli generate \
--git-host goauthentik.io \
--git-repo-id outpost \
--git-user-id api \
-i /local/schema.yml \
-g go \
-o /local/api \
--additional-properties=packageName=api,enumClassPrefix=true
workingDirectory: 'outpost/'
script: make gen-outpost
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'outpost/api/'

View File

@ -19,8 +19,7 @@ stages:
displayName: 'Install Node.js'
- task: CmdLine@2
inputs:
script: |
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli generate -i /local/schema.yml -g typescript-fetch -o /local/web/api --additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=authentik-api,npmVersion=1.0.0
script: make gen-web
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'web/api/'

View File

@ -36,18 +36,12 @@ Run `make gen` to run all unittests and generated an updated swagger document fo
By default, no transpiled bundle of the frontend is included. To build the UI, you need Node 12 or newer.
The Frontend also uses a generated API client to talk with the backend. To generate this client, you can use the [openapitools/openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator) CLI tool.
The Frontend also uses a generated API client to talk with the backend. To generate this client, [openapitools/openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator) is used.
If you want to generate the client without installing anything, run this command:
```shell
docker run \
--rm -v $(pwd):/local \
openapitools/openapi-generator-cli generate \
-i /local/schema.yml \
-g typescript-fetch \
-o /local/web/api \
--additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=authentik-api,npmVersion=1.0.0
make gen-web
```
To build the UI, run these commands: