From 770041d1d684e48068ed09293c047815250e03c3 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 21 Oct 2024 10:35:21 +0200 Subject: [PATCH 01/53] move tsp to resources Signed-off-by: munishchouhan --- .github/workflows/typespec.yml | 4 +-- build.gradle | 29 +++++++++++++++---- src/main/resources/typespec/index.html | 21 ++++++++++++++ .../main/resources/typespec}/main.tsp | 0 .../typespec}/models/BuildStatusResponse.tsp | 0 .../resources/typespec}/models/CondaOpts.tsp | 0 .../typespec}/models/ContainerConfig.tsp | 0 .../models/ContainerInspectConfig.tsp | 0 .../models/ContainerInspectRequest.tsp | 0 .../models/ContainerInspectResponse.tsp | 0 .../typespec}/models/ContainerLayer.tsp | 0 .../models/ContainerMirrorResponse.tsp | 0 .../typespec}/models/ContainerPlatform.tsp | 0 .../typespec}/models/ContainerRequest.tsp | 0 .../typespec}/models/ContainerResponse.tsp | 0 .../typespec}/models/ContainerStatus.tsp | 0 .../models/ContainerStatusResponse.tsp | 0 .../resources/typespec}/models/Manifest.tsp | 0 .../typespec}/models/ManifestLayer.tsp | 0 .../typespec}/models/MetricsResponse.tsp | 0 .../resources/typespec}/models/Packages.tsp | 0 .../resources/typespec}/models/RootFS.tsp | 0 .../resources/typespec}/models/ScanLevel.tsp | 0 .../resources/typespec}/models/ScanMode.tsp | 0 .../resources/typespec}/models/Status.tsp | 0 .../main/resources/typespec}/models/User.tsp | 0 .../models/ValidateRegistryCredsRequest.tsp | 0 .../typespec}/models/Vulnerability.tsp | 0 .../typespec}/models/WaveBuildRecord.tsp | 0 .../typespec}/models/WaveContainerRecord.tsp | 0 .../typespec}/models/WaveScanRecord.tsp | 0 .../resources/typespec}/models/models.tsp | 0 .../main/resources/typespec}/package.json | 0 .../main/resources/typespec}/routes.tsp | 0 .../main/resources/typespec}/tspconfig.yaml | 0 35 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/typespec/index.html rename {typespec => src/main/resources/typespec}/main.tsp (100%) rename {typespec => src/main/resources/typespec}/models/BuildStatusResponse.tsp (100%) rename {typespec => src/main/resources/typespec}/models/CondaOpts.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerConfig.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerInspectConfig.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerInspectRequest.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerInspectResponse.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerLayer.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerMirrorResponse.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerPlatform.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerRequest.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerResponse.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerStatus.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ContainerStatusResponse.tsp (100%) rename {typespec => src/main/resources/typespec}/models/Manifest.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ManifestLayer.tsp (100%) rename {typespec => src/main/resources/typespec}/models/MetricsResponse.tsp (100%) rename {typespec => src/main/resources/typespec}/models/Packages.tsp (100%) rename {typespec => src/main/resources/typespec}/models/RootFS.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ScanLevel.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ScanMode.tsp (100%) rename {typespec => src/main/resources/typespec}/models/Status.tsp (100%) rename {typespec => src/main/resources/typespec}/models/User.tsp (100%) rename {typespec => src/main/resources/typespec}/models/ValidateRegistryCredsRequest.tsp (100%) rename {typespec => src/main/resources/typespec}/models/Vulnerability.tsp (100%) rename {typespec => src/main/resources/typespec}/models/WaveBuildRecord.tsp (100%) rename {typespec => src/main/resources/typespec}/models/WaveContainerRecord.tsp (100%) rename {typespec => src/main/resources/typespec}/models/WaveScanRecord.tsp (100%) rename {typespec => src/main/resources/typespec}/models/models.tsp (100%) rename {typespec => src/main/resources/typespec}/package.json (100%) rename {typespec => src/main/resources/typespec}/routes.tsp (100%) rename {typespec => src/main/resources/typespec}/tspconfig.yaml (100%) diff --git a/.github/workflows/typespec.yml b/.github/workflows/typespec.yml index 8d9adaa33..4371292ac 100644 --- a/.github/workflows/typespec.yml +++ b/.github/workflows/typespec.yml @@ -6,11 +6,11 @@ on: branches: - '**' paths : - - 'typespec/**' + - '../../src/main/resources/typespec/**' pull_request: types: [opened, reopened, synchronize] paths: - - 'typespec/**' + - '../../src/main/resources/typespec/**' permissions: contents: read diff --git a/build.gradle b/build.gradle index 28442ab3d..9c50fe284 100644 --- a/build.gradle +++ b/build.gradle @@ -170,20 +170,37 @@ test { } /** Update version number for backend app and modules */ -task buildInfo { doLast { - def info = """\ +tasks.register('buildInfo') { + doLast { + def info = """\ name=${project.name} group=${project.group} version=${version} commitId=${project.property('commitId')} """.stripIndent().toString() - def f = file("${buildDir}/resources/main/META-INF/build-info.properties") - f.parentFile.mkdirs() - f.text = info -} } + def f = file("${buildDir}/resources/main/META-INF/build-info.properties") + f.parentFile.mkdirs() + f.text = info + } +} buildInfo.dependsOn processResources compileGroovy.dependsOn buildInfo +tasks.register('tspInstall', Exec) { + description = 'Install TypeSpec dependencies' + group = 'TypeSpec' + workingDir "$projectDir/src/main/resources/typespec" + commandLine 'npx', 'tsp', 'install' +} +tasks.register('tspCompile', Exec) { + description = 'Compile TypeSpec files' + group = 'TypeSpec' + workingDir "$projectDir/src/main/resources/typespec" + commandLine 'npx', 'tsp', 'compile', '.' +} +tspCompile.dependsOn tspInstall +build.dependsOn tspCompile + jacoco { toolVersion '0.8.12' } diff --git a/src/main/resources/typespec/index.html b/src/main/resources/typespec/index.html new file mode 100644 index 000000000..e30c9d94a --- /dev/null +++ b/src/main/resources/typespec/index.html @@ -0,0 +1,21 @@ + + + + + + API Documentation + + + + + + + + diff --git a/typespec/main.tsp b/src/main/resources/typespec/main.tsp similarity index 100% rename from typespec/main.tsp rename to src/main/resources/typespec/main.tsp diff --git a/typespec/models/BuildStatusResponse.tsp b/src/main/resources/typespec/models/BuildStatusResponse.tsp similarity index 100% rename from typespec/models/BuildStatusResponse.tsp rename to src/main/resources/typespec/models/BuildStatusResponse.tsp diff --git a/typespec/models/CondaOpts.tsp b/src/main/resources/typespec/models/CondaOpts.tsp similarity index 100% rename from typespec/models/CondaOpts.tsp rename to src/main/resources/typespec/models/CondaOpts.tsp diff --git a/typespec/models/ContainerConfig.tsp b/src/main/resources/typespec/models/ContainerConfig.tsp similarity index 100% rename from typespec/models/ContainerConfig.tsp rename to src/main/resources/typespec/models/ContainerConfig.tsp diff --git a/typespec/models/ContainerInspectConfig.tsp b/src/main/resources/typespec/models/ContainerInspectConfig.tsp similarity index 100% rename from typespec/models/ContainerInspectConfig.tsp rename to src/main/resources/typespec/models/ContainerInspectConfig.tsp diff --git a/typespec/models/ContainerInspectRequest.tsp b/src/main/resources/typespec/models/ContainerInspectRequest.tsp similarity index 100% rename from typespec/models/ContainerInspectRequest.tsp rename to src/main/resources/typespec/models/ContainerInspectRequest.tsp diff --git a/typespec/models/ContainerInspectResponse.tsp b/src/main/resources/typespec/models/ContainerInspectResponse.tsp similarity index 100% rename from typespec/models/ContainerInspectResponse.tsp rename to src/main/resources/typespec/models/ContainerInspectResponse.tsp diff --git a/typespec/models/ContainerLayer.tsp b/src/main/resources/typespec/models/ContainerLayer.tsp similarity index 100% rename from typespec/models/ContainerLayer.tsp rename to src/main/resources/typespec/models/ContainerLayer.tsp diff --git a/typespec/models/ContainerMirrorResponse.tsp b/src/main/resources/typespec/models/ContainerMirrorResponse.tsp similarity index 100% rename from typespec/models/ContainerMirrorResponse.tsp rename to src/main/resources/typespec/models/ContainerMirrorResponse.tsp diff --git a/typespec/models/ContainerPlatform.tsp b/src/main/resources/typespec/models/ContainerPlatform.tsp similarity index 100% rename from typespec/models/ContainerPlatform.tsp rename to src/main/resources/typespec/models/ContainerPlatform.tsp diff --git a/typespec/models/ContainerRequest.tsp b/src/main/resources/typespec/models/ContainerRequest.tsp similarity index 100% rename from typespec/models/ContainerRequest.tsp rename to src/main/resources/typespec/models/ContainerRequest.tsp diff --git a/typespec/models/ContainerResponse.tsp b/src/main/resources/typespec/models/ContainerResponse.tsp similarity index 100% rename from typespec/models/ContainerResponse.tsp rename to src/main/resources/typespec/models/ContainerResponse.tsp diff --git a/typespec/models/ContainerStatus.tsp b/src/main/resources/typespec/models/ContainerStatus.tsp similarity index 100% rename from typespec/models/ContainerStatus.tsp rename to src/main/resources/typespec/models/ContainerStatus.tsp diff --git a/typespec/models/ContainerStatusResponse.tsp b/src/main/resources/typespec/models/ContainerStatusResponse.tsp similarity index 100% rename from typespec/models/ContainerStatusResponse.tsp rename to src/main/resources/typespec/models/ContainerStatusResponse.tsp diff --git a/typespec/models/Manifest.tsp b/src/main/resources/typespec/models/Manifest.tsp similarity index 100% rename from typespec/models/Manifest.tsp rename to src/main/resources/typespec/models/Manifest.tsp diff --git a/typespec/models/ManifestLayer.tsp b/src/main/resources/typespec/models/ManifestLayer.tsp similarity index 100% rename from typespec/models/ManifestLayer.tsp rename to src/main/resources/typespec/models/ManifestLayer.tsp diff --git a/typespec/models/MetricsResponse.tsp b/src/main/resources/typespec/models/MetricsResponse.tsp similarity index 100% rename from typespec/models/MetricsResponse.tsp rename to src/main/resources/typespec/models/MetricsResponse.tsp diff --git a/typespec/models/Packages.tsp b/src/main/resources/typespec/models/Packages.tsp similarity index 100% rename from typespec/models/Packages.tsp rename to src/main/resources/typespec/models/Packages.tsp diff --git a/typespec/models/RootFS.tsp b/src/main/resources/typespec/models/RootFS.tsp similarity index 100% rename from typespec/models/RootFS.tsp rename to src/main/resources/typespec/models/RootFS.tsp diff --git a/typespec/models/ScanLevel.tsp b/src/main/resources/typespec/models/ScanLevel.tsp similarity index 100% rename from typespec/models/ScanLevel.tsp rename to src/main/resources/typespec/models/ScanLevel.tsp diff --git a/typespec/models/ScanMode.tsp b/src/main/resources/typespec/models/ScanMode.tsp similarity index 100% rename from typespec/models/ScanMode.tsp rename to src/main/resources/typespec/models/ScanMode.tsp diff --git a/typespec/models/Status.tsp b/src/main/resources/typespec/models/Status.tsp similarity index 100% rename from typespec/models/Status.tsp rename to src/main/resources/typespec/models/Status.tsp diff --git a/typespec/models/User.tsp b/src/main/resources/typespec/models/User.tsp similarity index 100% rename from typespec/models/User.tsp rename to src/main/resources/typespec/models/User.tsp diff --git a/typespec/models/ValidateRegistryCredsRequest.tsp b/src/main/resources/typespec/models/ValidateRegistryCredsRequest.tsp similarity index 100% rename from typespec/models/ValidateRegistryCredsRequest.tsp rename to src/main/resources/typespec/models/ValidateRegistryCredsRequest.tsp diff --git a/typespec/models/Vulnerability.tsp b/src/main/resources/typespec/models/Vulnerability.tsp similarity index 100% rename from typespec/models/Vulnerability.tsp rename to src/main/resources/typespec/models/Vulnerability.tsp diff --git a/typespec/models/WaveBuildRecord.tsp b/src/main/resources/typespec/models/WaveBuildRecord.tsp similarity index 100% rename from typespec/models/WaveBuildRecord.tsp rename to src/main/resources/typespec/models/WaveBuildRecord.tsp diff --git a/typespec/models/WaveContainerRecord.tsp b/src/main/resources/typespec/models/WaveContainerRecord.tsp similarity index 100% rename from typespec/models/WaveContainerRecord.tsp rename to src/main/resources/typespec/models/WaveContainerRecord.tsp diff --git a/typespec/models/WaveScanRecord.tsp b/src/main/resources/typespec/models/WaveScanRecord.tsp similarity index 100% rename from typespec/models/WaveScanRecord.tsp rename to src/main/resources/typespec/models/WaveScanRecord.tsp diff --git a/typespec/models/models.tsp b/src/main/resources/typespec/models/models.tsp similarity index 100% rename from typespec/models/models.tsp rename to src/main/resources/typespec/models/models.tsp diff --git a/typespec/package.json b/src/main/resources/typespec/package.json similarity index 100% rename from typespec/package.json rename to src/main/resources/typespec/package.json diff --git a/typespec/routes.tsp b/src/main/resources/typespec/routes.tsp similarity index 100% rename from typespec/routes.tsp rename to src/main/resources/typespec/routes.tsp diff --git a/typespec/tspconfig.yaml b/src/main/resources/typespec/tspconfig.yaml similarity index 100% rename from typespec/tspconfig.yaml rename to src/main/resources/typespec/tspconfig.yaml From a64fa697019a4ffcd1ab9911163937d0ff5d084f Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 21 Oct 2024 10:52:04 +0200 Subject: [PATCH 02/53] minor change Signed-off-by: munishchouhan --- src/main/resources/typespec/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/typespec/index.html b/src/main/resources/typespec/index.html index e30c9d94a..1adebd16b 100644 --- a/src/main/resources/typespec/index.html +++ b/src/main/resources/typespec/index.html @@ -3,7 +3,7 @@ - API Documentation + Wave API Documentation Date: Wed, 23 Oct 2024 13:01:42 +0200 Subject: [PATCH 03/53] added Dockerfile and build_and_push.sh Signed-off-by: munishchouhan --- typespec/Dockerfile | 12 +++++++++++ typespec/build_and_push.sh | 21 +++++++++++++++++++ .../typespec => typespec}/index.html | 2 +- .../resources/typespec => typespec}/main.tsp | 0 .../models/BuildStatusResponse.tsp | 0 .../models/CondaOpts.tsp | 0 .../models/ContainerConfig.tsp | 0 .../models/ContainerInspectConfig.tsp | 0 .../models/ContainerInspectRequest.tsp | 0 .../models/ContainerInspectResponse.tsp | 0 .../models/ContainerLayer.tsp | 0 .../models/ContainerMirrorResponse.tsp | 0 .../models/ContainerPlatform.tsp | 0 .../models/ContainerRequest.tsp | 0 .../models/ContainerResponse.tsp | 0 .../models/ContainerStatus.tsp | 0 .../models/ContainerStatusResponse.tsp | 0 .../typespec => typespec}/models/Manifest.tsp | 0 .../models/ManifestLayer.tsp | 0 .../models/MetricsResponse.tsp | 0 .../typespec => typespec}/models/Packages.tsp | 0 .../typespec => typespec}/models/RootFS.tsp | 0 .../models/ScanLevel.tsp | 0 .../typespec => typespec}/models/ScanMode.tsp | 0 .../typespec => typespec}/models/Status.tsp | 0 .../typespec => typespec}/models/User.tsp | 0 .../models/ValidateRegistryCredsRequest.tsp | 0 .../models/Vulnerability.tsp | 0 .../models/WaveBuildRecord.tsp | 0 .../models/WaveContainerRecord.tsp | 0 .../models/WaveScanRecord.tsp | 0 .../typespec => typespec}/models/models.tsp | 0 .../typespec => typespec}/package.json | 0 .../typespec => typespec}/routes.tsp | 0 .../typespec => typespec}/tspconfig.yaml | 0 35 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 typespec/Dockerfile create mode 100644 typespec/build_and_push.sh rename {src/main/resources/typespec => typespec}/index.html (88%) rename {src/main/resources/typespec => typespec}/main.tsp (100%) rename {src/main/resources/typespec => typespec}/models/BuildStatusResponse.tsp (100%) rename {src/main/resources/typespec => typespec}/models/CondaOpts.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerConfig.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerInspectConfig.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerInspectRequest.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerInspectResponse.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerLayer.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerMirrorResponse.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerPlatform.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerRequest.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerResponse.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerStatus.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ContainerStatusResponse.tsp (100%) rename {src/main/resources/typespec => typespec}/models/Manifest.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ManifestLayer.tsp (100%) rename {src/main/resources/typespec => typespec}/models/MetricsResponse.tsp (100%) rename {src/main/resources/typespec => typespec}/models/Packages.tsp (100%) rename {src/main/resources/typespec => typespec}/models/RootFS.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ScanLevel.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ScanMode.tsp (100%) rename {src/main/resources/typespec => typespec}/models/Status.tsp (100%) rename {src/main/resources/typespec => typespec}/models/User.tsp (100%) rename {src/main/resources/typespec => typespec}/models/ValidateRegistryCredsRequest.tsp (100%) rename {src/main/resources/typespec => typespec}/models/Vulnerability.tsp (100%) rename {src/main/resources/typespec => typespec}/models/WaveBuildRecord.tsp (100%) rename {src/main/resources/typespec => typespec}/models/WaveContainerRecord.tsp (100%) rename {src/main/resources/typespec => typespec}/models/WaveScanRecord.tsp (100%) rename {src/main/resources/typespec => typespec}/models/models.tsp (100%) rename {src/main/resources/typespec => typespec}/package.json (100%) rename {src/main/resources/typespec => typespec}/routes.tsp (100%) rename {src/main/resources/typespec => typespec}/tspconfig.yaml (100%) diff --git a/typespec/Dockerfile b/typespec/Dockerfile new file mode 100644 index 000000000..90d6b08fa --- /dev/null +++ b/typespec/Dockerfile @@ -0,0 +1,12 @@ +# Use an official Nginx image from the Docker Hub +FROM nginx:alpine + +# Copy the index.html and openapi.yaml to the Nginx html directory +COPY index.html /usr/share/nginx/html/ +COPY tsp-output/@typespec/openapi3/openapi.yaml /usr/share/nginx/html/ + +# Expose port 80 +EXPOSE 80 + +# Start Nginx when the container starts +CMD ["nginx", "-g", "daemon off;"] diff --git a/typespec/build_and_push.sh b/typespec/build_and_push.sh new file mode 100644 index 000000000..4fc5e18e2 --- /dev/null +++ b/typespec/build_and_push.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +echo "Compiling TypeSpec..." +tsp compile + +echo "Installing TypeSpec packages..." +tsp install . + +IMAGE_NAME="your-docker-repo/openapi-server" +echo "Building Docker image: $IMAGE_NAME..." +docker build -t "$IMAGE_NAME" . + +echo "Logging in to Docker registry..." +echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + +echo "Pushing Docker image to the registry..." +docker push "$IMAGE_NAME" + +echo "Docker image pushed successfully: $IMAGE_NAME" diff --git a/src/main/resources/typespec/index.html b/typespec/index.html similarity index 88% rename from src/main/resources/typespec/index.html rename to typespec/index.html index 1adebd16b..8b0f3b6c8 100644 --- a/src/main/resources/typespec/index.html +++ b/typespec/index.html @@ -7,7 +7,7 @@ Date: Wed, 23 Oct 2024 13:06:26 +0200 Subject: [PATCH 04/53] added version and typo Signed-off-by: munishchouhan --- typespec/build_and_push.sh | 21 --------------------- typespec/routes.tsp | 3 ++- 2 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 typespec/build_and_push.sh diff --git a/typespec/build_and_push.sh b/typespec/build_and_push.sh deleted file mode 100644 index 4fc5e18e2..000000000 --- a/typespec/build_and_push.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -e - -echo "Compiling TypeSpec..." -tsp compile - -echo "Installing TypeSpec packages..." -tsp install . - -IMAGE_NAME="your-docker-repo/openapi-server" -echo "Building Docker image: $IMAGE_NAME..." -docker build -t "$IMAGE_NAME" . - -echo "Logging in to Docker registry..." -echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - -echo "Pushing Docker image to the registry..." -docker push "$IMAGE_NAME" - -echo "Docker image pushed successfully: $IMAGE_NAME" diff --git a/typespec/routes.tsp b/typespec/routes.tsp index 8e6f8d957..46481cb93 100644 --- a/typespec/routes.tsp +++ b/typespec/routes.tsp @@ -5,8 +5,9 @@ using TypeSpec.Rest; @service({ title: "Wave service", + version: "1.13.5" }) -@server("https://wave.seqera.io", "wave endopint") +@server("https://wave.seqera.io", "wave endpoint") namespace wave { @route("/v1alpha2/container") interface ContainerService { From d185114cbae1ced9b646796081a758352f50da22 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 23 Oct 2024 13:08:34 +0200 Subject: [PATCH 05/53] reverted typespec.yml Signed-off-by: munishchouhan --- .github/workflows/typespec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/typespec.yml b/.github/workflows/typespec.yml index 4371292ac..8d9adaa33 100644 --- a/.github/workflows/typespec.yml +++ b/.github/workflows/typespec.yml @@ -6,11 +6,11 @@ on: branches: - '**' paths : - - '../../src/main/resources/typespec/**' + - 'typespec/**' pull_request: types: [opened, reopened, synchronize] paths: - - '../../src/main/resources/typespec/**' + - 'typespec/**' permissions: contents: read From 8fcc72dde48ffa0fb96c4c306f3d7228af80caa2 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 23 Oct 2024 13:09:46 +0200 Subject: [PATCH 06/53] reverted build.gradle Signed-off-by: munishchouhan --- build.gradle | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index 9c50fe284..28442ab3d 100644 --- a/build.gradle +++ b/build.gradle @@ -170,37 +170,20 @@ test { } /** Update version number for backend app and modules */ -tasks.register('buildInfo') { - doLast { - def info = """\ +task buildInfo { doLast { + def info = """\ name=${project.name} group=${project.group} version=${version} commitId=${project.property('commitId')} """.stripIndent().toString() - def f = file("${buildDir}/resources/main/META-INF/build-info.properties") - f.parentFile.mkdirs() - f.text = info - } -} + def f = file("${buildDir}/resources/main/META-INF/build-info.properties") + f.parentFile.mkdirs() + f.text = info +} } buildInfo.dependsOn processResources compileGroovy.dependsOn buildInfo -tasks.register('tspInstall', Exec) { - description = 'Install TypeSpec dependencies' - group = 'TypeSpec' - workingDir "$projectDir/src/main/resources/typespec" - commandLine 'npx', 'tsp', 'install' -} -tasks.register('tspCompile', Exec) { - description = 'Compile TypeSpec files' - group = 'TypeSpec' - workingDir "$projectDir/src/main/resources/typespec" - commandLine 'npx', 'tsp', 'compile', '.' -} -tspCompile.dependsOn tspInstall -build.dependsOn tspCompile - jacoco { toolVersion '0.8.12' } From a79474b87c13f060ba193245ed60c5c6739a5cf3 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 28 Oct 2024 08:05:54 +0100 Subject: [PATCH 07/53] added tag-and-push-docs.sh Signed-off-by: munishchouhan --- .github/workflows/build.yml | 1 + typespec/tag-and-push-docs.sh | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 typespec/tag-and-push-docs.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 503bce24f..ea689dc71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,6 +81,7 @@ jobs: if: "contains(github.event.head_commit.message, '[release]')" run: | bash tag-and-push.sh + bash tag-and-push-docs.sh env: GRADLE_OPTS: '-Dorg.gradle.daemon=false' AWS_ACCESS_KEY_ID: ${{secrets.TOWER_CI_AWS_ACCESS}} diff --git a/typespec/tag-and-push-docs.sh b/typespec/tag-and-push-docs.sh new file mode 100755 index 000000000..b1b88d80e --- /dev/null +++ b/typespec/tag-and-push-docs.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Wave, containers provisioning service +# Copyright (c) 2023-2024, Seqera Labs +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# Tag and and push the the GitHub repo and Docker images + +set -e +set -x +SED=sed +[[ $(uname) == Darwin ]] && SED=gsed + +RELEASE=${RELEASE:-$(git show -s --format='%s' | $SED -rn 's/.*\[(release)\].*/\1/p')} +if [[ $RELEASE ]]; then + npm install -g @typespec/compiler + + cd typespec + + tsp install + + tsp compile . + + docker build -t 195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/wave-docs:$VERSION . + + docker push 195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/wave-docs:$VERSION +fi From 9600f41b66692ebe8643f6ad748a9cb82d459d79 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 15 Jan 2025 13:34:23 +0100 Subject: [PATCH 08/53] change repo Signed-off-by: munishchouhan --- typespec/tag-and-push-docs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typespec/tag-and-push-docs.sh b/typespec/tag-and-push-docs.sh index b1b88d80e..67ea6f897 100755 --- a/typespec/tag-and-push-docs.sh +++ b/typespec/tag-and-push-docs.sh @@ -34,7 +34,7 @@ if [[ $RELEASE ]]; then tsp compile . - docker build -t 195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/wave-docs:$VERSION . + docker build -t 195996028523.dkr.ecr.eu-west-1.amazonaws.com/wave/wave-docs:$VERSION . - docker push 195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/wave-docs:$VERSION + docker push 195996028523.dkr.ecr.eu-west-1.amazonaws.com/wave/wave-docs:$VERSION fi From 532303c860457ce7d21dead0ec59e01c076bb382 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 15 Jan 2025 15:17:14 +0100 Subject: [PATCH 09/53] added swagger ui Signed-off-by: munishchouhan --- typespec/index.html | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/typespec/index.html b/typespec/index.html index 8b0f3b6c8..82a88f7b4 100644 --- a/typespec/index.html +++ b/typespec/index.html @@ -4,18 +4,25 @@ Wave API Documentation + - - - - +
+ + + From c1dd3dc17fd3454585a01a6b28cdc16260afe9bd Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 15 Jan 2025 15:27:11 +0100 Subject: [PATCH 10/53] added doc release job Signed-off-by: munishchouhan --- .github/workflows/typespec.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/typespec.yml b/.github/workflows/typespec.yml index 8d9adaa33..e72707100 100644 --- a/.github/workflows/typespec.yml +++ b/.github/workflows/typespec.yml @@ -38,3 +38,12 @@ jobs: tsp install tsp compile . + - name: Release + if: "contains(github.event.head_commit.message, '[release]')" + run: | + bash typespec/tag-and-push-docs.sh + env: + GRADLE_OPTS: '-Dorg.gradle.daemon=false' + AWS_ACCESS_KEY_ID: ${{secrets.TOWER_CI_AWS_ACCESS}} + AWS_SECRET_ACCESS_KEY: ${{secrets.TOWER_CI_AWS_SECRET}} + GITHUB_TOKEN: ${{ secrets.GH_SEQERA_TOKEN }} From ff8b60d370fbcb76f93f4104c138fc0dad0bfb7b Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 15 Jan 2025 15:27:43 +0100 Subject: [PATCH 11/53] removed doc release job from build.yml [ci skip] Signed-off-by: munishchouhan --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 100595bd8..4cf422e24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,7 +81,6 @@ jobs: if: "contains(github.event.head_commit.message, '[release]')" run: | bash tag-and-push.sh - bash tag-and-push-docs.sh env: GRADLE_OPTS: '-Dorg.gradle.daemon=false' AWS_ACCESS_KEY_ID: ${{secrets.TOWER_CI_AWS_ACCESS}} From d23bf8070876e66cf7b8ad7b16298c4e474ab287 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Wed, 15 Jan 2025 15:59:20 +0100 Subject: [PATCH 12/53] [release-docs] version 1.16.7 Signed-off-by: munishchouhan --- .github/workflows/typespec.yml | 2 +- typespec/index.html | 2 +- typespec/main.tsp | 1 + typespec/package.json | 10 +++++----- typespec/routes.tsp | 8 ++++++-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/typespec.yml b/.github/workflows/typespec.yml index e72707100..e8491b951 100644 --- a/.github/workflows/typespec.yml +++ b/.github/workflows/typespec.yml @@ -39,7 +39,7 @@ jobs: tsp compile . - name: Release - if: "contains(github.event.head_commit.message, '[release]')" + if: "contains(github.event.head_commit.message, '[release-docs]')" run: | bash typespec/tag-and-push-docs.sh env: diff --git a/typespec/index.html b/typespec/index.html index 82a88f7b4..192cf045a 100644 --- a/typespec/index.html +++ b/typespec/index.html @@ -13,7 +13,7 @@