Gradle: Could not get unknown property

Good day I am trying to work in a CI CD environment with Bitbucket Pipelines however I cannot define my own signing key as this is what I get

Could not get unknown property 'APPNAME_KEYSTORE_FILE'

This is the app gradle file looks like

android {
        compileSdk Integer.parseInt(ANDROID_BUILD_COMPILED_SDK_VERSION)
    
        defaultConfig {
            applicationId "com.app.name"
            minSdk Integer.parseInt(ANDROID_BUILD_MIN_SDK_VERSION)
            targetSdk Integer.parseInt(ANDROID_BUILD_TARGET_SDK_VERSION)
            versionCode project.hasProperty('BUILD_NUMBER') ? project['BUILD_NUMBER'].toInteger() : 14
            versionName "1.3.3"
            vectorDrawables.useSupportLibrary = true
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
    
        signingConfigs {
            debug {
                storeFile file(DEBUG_KEYSTORE_FILE)
                storePassword DEBUG_KEYSTORE_PASSWORD
                keyAlias DEBUG_KEYSTORE_KEY_ALIAS
                keyPassword DEBUG_KEYSTORE_KEY_PASSWORD
            }
            release {
                storeFile file(APPNAME_KEYSTORE_FILE)
                storePassword APPNAME_KEYSTORE_PASSWORD
                keyAlias APPNAME_KEYSTORE_KEY_ALIAS
                keyPassword APPNAME_KEYSTORE_KEY_PASSWORD
            }
        }
    
        buildTypes {
            debug {
                debuggable true
                minifyEnabled true
                shrinkResources true
                multiDexEnabled true
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    
                signingConfig signingConfigs.debug
            }
            release {
                debuggable false
                minifyEnabled true
                shrinkResources true
                multiDexEnabled true
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    
                signingConfig signingConfigs.release
            }
        }
    
        compileOptions {
            // Flag to enable support for the new language APIs
            coreLibraryDesugaringEnabled true
            // Sets Java compatibility to Java 8
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    
        kotlinOptions {
            jvmTarget = "1.8"
        }
    
        lintOptions {
            disable "MissingClass"
        }
    
        buildFeatures {
            viewBinding true
        }
    }
    
    play {
        serviceAccountCredentials.set(file(GOOGLE_PLAY_API_KEY_FILE))
    }

However when running it on local I can successfully build APK or AAB.

This is the complete SO question

Thank you