github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/activestate.generators.yaml (about) 1 scripts: 2 - name: generate-api-client 3 language: bash 4 description: Generates the mono-api client files 5 value: | 6 echo "IMPORTANT!!! mono API and inventory API have to be in sync. Consider running state run generate-inventory-client" 7 WD=$(pwd) 8 pushd pkg/platform/api/mono 9 swagger generate client -f ${WD}/../TheHomeRepot/service/api/swagger/swagger.yaml -A mono -a mono_operations -m mono_models -c mono_client 10 popd 11 - name: generate-secrets-client 12 language: bash 13 description: Generates the secrets-api client files 14 value: | 15 WD=$(pwd) 16 pushd pkg/platform/api/secrets 17 swagger generate client -f ${WD}/../TheHomeRepot/service/secrets/api/swagger.yaml -A secrets -a secrets_operations -m secrets_models -c secrets_client 18 popd 19 - name: generate-headchef-client 20 language: bash 21 description: Generates the headchef-api client files 22 value: | 23 WD=$(pwd) 24 pushd pkg/platform/api/headchef 25 swagger generate client --with-flatten full -f ${WD}/../TheHomeRepot/service/head-chef/swagger.json -A headchef -a headchef_operations -m headchef_models -c headchef_client 26 popd 27 - name: generate-logstreamer-client 28 language: bash 29 description: Generates the buildlog-streamer client files 30 value: | 31 WD=$(pwd) 32 pushd pkg/platform/api/buildlogstream 33 swagger generate client --with-flatten full -f ${WD}/../TheHomeRepot/service/build-log-streamer/swagger.yaml -A buildlogstream -a buildlogstream_operations -m buildlogstream_models -c buildlogstream_client 34 popd 35 - name: generate-inventory-client 36 language: bash 37 description: Generates the inventory-api client files 38 value: | 39 echo "IMPORTANT!!! mono API and inventory API have to be in sync. Consider running state run generate-api-client" 40 WD=$(pwd) 41 pushd pkg/platform/api/inventory 42 swagger generate client --with-flatten full -f ${WD}/../TheHomeRepot/service/inventory-api-v1/swagger.json -A inventory -a inventory_operations -m inventory_models -c inventory_client 43 popd 44 - name: generate-clients 45 language: bash 46 description: Generates all api clients 47 value: | 48 $scripts.generate-api-client.path() 49 $scripts.generate-secrets-client.path() 50 $scripts.generate-headchef-client.path() 51 $scripts.generate-inventory-client.path() 52 - name: generate-locale 53 language: bash 54 description: Detects new localisation calls and generates placeholder entries in en-us.yaml 55 value: python3 scripts/locale-generator.py 56 - name: generate-payload 57 language: bash 58 description: Generate payload for installer / update archives 59 value: | 60 set -e 61 $constants.SET_ENV 62 63 echo "# Generate payload" 64 go run ./scripts/ci/payload-generator/main.go "$@" 65 - name: generate-update 66 language: bash 67 description: Generate update files 68 value: | 69 set -e 70 export GOARCH=${1:-amd64} 71 $constants.SET_ENV 72 73 $scripts.generate-payload.path() 74 75 echo "# Create update dir" 76 mkdir -p ./build/update 77 78 echo "# Generate update from temp dir" 79 go run scripts/ci/update-generator/main.go -o ./build/update 80 - name: generate-remote-install-deployment 81 language: bash 82 value: go run scripts/ci/deploy-generator/remote-installer/main.go "$@" 83 - name: generate-graph 84 language: bash 85 description: Generates graph server and client files 86 value: | 87 go install github.com/99designs/gqlgen@v0.17.24 88 cd ./cmd/state-svc && gqlgen --verbose 89 - name: generate-test-update 90 language: bash 91 standalone: true 92 description: | 93 Generate tests update files. These can be safely uploaded to s3, and can be used to test an installation/update 94 value: | 95 set -e 96 $constants.SET_ENV 97 98 TEST_VERSION="99.99.9999" 99 TEST_CHANNEL=${1:-test-channel} 100 TEST_PREPARED_DIR=./build/payload/state-install 101 TEST_PREPARED_BIN_DIR=${TEST_PREPARED_DIR}/bin 102 TEST_FAKE_EXEC=./build/fakeversioncmd 103 TEST_ARCHIVE_DIR=./build/test-update 104 mkdir -p ${TEST_ARCHIVE_DIR} 105 106 copy_test_payload () { 107 cp -a ${TEST_FAKE_EXEC} ${TEST_PREPARED_BIN_DIR}/$constants.BUILD_TARGET 108 cp -a ${TEST_FAKE_EXEC} ${TEST_PREPARED_BIN_DIR}/$constants.BUILD_DAEMON_TARGET 109 cp -a ${TEST_FAKE_EXEC} ${TEST_PREPARED_BIN_DIR}/$constants.BUILD_EXEC_TARGET 110 cp -a ${BUILD_TARGET_DIR}/$constants.BUILD_INSTALLER_TARGET ${TEST_PREPARED_DIR} 111 } 112 113 go build -o ${TEST_FAKE_EXEC} ./internal/testhelpers/installation/fakeversioncmd 114 go run scripts/ci/payload-generator/main.go -v ${TEST_VERSION} 115 copy_test_payload 116 go run scripts/ci/update-generator/main.go -v ${TEST_VERSION} -o ${TEST_ARCHIVE_DIR} 117 118 echo "compile ${TEST_CHANNEL} update" 119 go build -o ${TEST_FAKE_EXEC} -ldflags "-X main.channel=${TEST_CHANNEL}" ./internal/testhelpers/installation/fakeversioncmd 120 go run scripts/ci/payload-generator/main.go -b ${TEST_CHANNEL} -v ${TEST_VERSION} 121 copy_test_payload 122 go run scripts/ci/update-generator/main.go -b ${TEST_CHANNEL} -v ${TEST_VERSION} -o ${TEST_ARCHIVE_DIR} 123 - name: generate-versions-list 124 language: bash 125 standalone: true 126 description: Generates master versions.json from S3 and info.json's from generate-update 127 value: | 128 set -e 129 $constants.SET_ENV 130 131 go run scripts/ci/update-version-list/main.go ./build/update