Skip to content

Commit

Permalink
Fix-CI scripts and references
Browse files Browse the repository at this point in the history
  • Loading branch information
micryc committed Mar 21, 2024
1 parent a1614e3 commit b9d9ac0
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: ["v31"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
branches: ["v31"]
schedule:
- cron: '0 19 * * 1'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
NAMESPACE_NAME="swagger-oss"
K8S_OBJECT_TYPE="daemonsets"
K8S_OBJECT_NAME="swagger-petstore-31"
DEPLOY_IMAGE="swaggerapi/swagger-petstore31:$SC_RELEASE_TAG"
DEPLOY_IMAGE="swaggerapi/petstore31:$SC_RELEASE_TAG"
workloadStatus=""
getStatus() {
Expand Down
2 changes: 1 addition & 1 deletion CI/docker-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ docker tag $DOCKER_PETSTORE_IMAGE_NAME:$SC_RELEASE_TAG $DOCKER_PETSTORE_IMAGE_NA
docker push $DOCKER_PETSTORE_IMAGE_NAME:$SC_RELEASE_TAG
docker push $DOCKER_PETSTORE_IMAGE_NAME:latest
echo "docker images:"
docker images | grep -i petstore3
docker images | grep -i petstore31
18 changes: 13 additions & 5 deletions CI/post-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@ mvn versions:commit
### update all other versions in files around to the next snapshot or new release, including readme and gradle ###
#####################

sc_find="version\: $SC_VERSION"
sc_replace="version: $SC_NEXT_VERSION-SNAPSHOT"
sc_find="version: $SC_VERSION"
sc_replace="version\: $SC_SC_NEXT_VERSION\-SNAPSHOT"
sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/design-first/petstore.yaml


sc_find="version: $SC_VERSION"
sc_replace="version\: $SC_SC_NEXT_VERSION\-SNAPSHOT"
sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/code-first/openapi.yaml


sc_find="\"version\" \: \"$SC_VERSION\""
sc_replace="\"version \: \"$SC_SC_NEXT_VERSION\-SNAPSHOT\""
sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/code-first/openapi.json

sc_find="version\: $SC_VERSION"
sc_replace="version: $SC_NEXT_VERSION-SNAPSHOT"
sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/design-first/petstore.yaml
sc_find="\"version\" \: \"$SC_VERSION\""
sc_replace="\"version \: \"$SC_NEXT_VERSION\-SNAPSHOT\""
sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/java/io/swagger/petstore/resource/DefinitionResource.java
10 changes: 9 additions & 1 deletion CI/prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,19 @@ sc_replace="version: $SC_VERSION"
sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/design-first/petstore.yaml



sc_find="version\: $SC_VERSION\-SNAPSHOT"
sc_replace="version: $SC_VERSION"
sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/code-first/openapi.yaml


sc_find="\"version \: \"$SC_VERSION\-SNAPSHOT\""
sc_replace="\"version\" \: \"$SC_VERSION\""
sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/code-first/openapi.json

sc_find="\"version \: \"$SC_VERSION\-SNAPSHOT\""
sc_replace="\"version\" \: \"$SC_VERSION\""
sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/java/io/swagger/petstore/resource/DefinitionResource.java

#####################
### build and test maven ###
#####################
Expand Down
2 changes: 1 addition & 1 deletion CI/publishRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def publishRelease(tag):
id = lastReleaseId(tag)
payload = "{\"tag_name\":\"" + tag + "\", "
payload += "\"draft\":" + "false" + ", "
payload += "\"target_commitish\":\"" + "master" + "\"}"
payload += "\"target_commitish\":\"" + "v31" + "\"}"
content = ghApiClient.postUrl('repos/swagger-api/swagger-petstore/releases/' + str(id), payload)
return content

Expand Down
4 changes: 2 additions & 2 deletions CI/releaseNotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def allPulls(releaseDate):
result = ""

baseurl = "https://api.github.com/repos/swagger-api/swagger-petstore/pulls/"
content = ghApiClient.readUrl('repos/swagger-api/swagger-petstore/pulls?state=closed&base=master&per_page=100')
content = ghApiClient.readUrl('repos/swagger-api/swagger-petstore/pulls?state=closed&base=v31&per_page=100')
for l in content:
stripped = l["url"][len(baseurl):]
mergedAt = l["merged_at"]
Expand All @@ -34,7 +34,7 @@ def addRelease(release_title, tag, content):
payload += "\"body\":" + json.dumps(content) + ", "
payload += "\"draft\":" + "true" + ", "
payload += "\"prerelease\":" + "false" + ", "
payload += "\"target_commitish\":\"" + "master" + "\"}"
payload += "\"target_commitish\":\"" + "v31" + "\"}"
content = ghApiClient.postUrl('repos/swagger-api/swagger-petstore/releases', payload)
return content

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
info = @Info(
title = "Swagger Petstore - OpenAPI 3.1",
summary = "Pet Store 3.1",
version = "1.0.3",
version = "1.0.3-SNAPSHOT",
description = "This is a sample Pet Store Server based on the OpenAPI 3.1 specification.\nYou can find out more about\nSwagger at [http://swagger.io](http://swagger.io).",
termsOfService = "http://swagger.io/terms/",
contact = @Contact (
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/code-first/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"name" : "Apache 2.0 AND (MIT OR GPL-2.0-only)",
"identifier" : "Apache-2.0 AND (MIT OR GPL-2.0-only)"
},
"version" : "1.0.3",
"version" : "1.0.3-SNAPSHOT",
"summary" : "Pet Store 3.1",
"x-namespace" : "swagger"
},
Expand Down

0 comments on commit b9d9ac0

Please sign in to comment.