diff --git a/hosting/scripts/linux/release-to-docker-hub.sh b/hosting/scripts/linux/release-to-docker-hub.sh index 5e3a01002f..ccb5fa09a0 100755 --- a/hosting/scripts/linux/release-to-docker-hub.sh +++ b/hosting/scripts/linux/release-to-docker-hub.sh @@ -1,12 +1,23 @@ #!/bin/bash tag=$1 -tag=${tag:-latest} +production=$2 + +if [[ ! "$tag" ]]; then + echo "No tag present. You must pass a tag to this script" + exit 1 +fi echo "Tagging images with tag: $tag" docker tag app-service budibase/apps:$tag docker tag worker-service budibase/worker:$tag -docker push budibase/apps:$tag -docker push budibase/worker:$tag +if [[ "$production" ]]; then + echo "Production Deployment. Tagging latest.." + docker tag app-service budibase/apps:latest + docker tag worker-service budibase/worker:latest +fi + +docker push --all-tags budibase/apps +docker push --all-tags budibase/worker diff --git a/package.json b/package.json index 431184a70a..05c69e54dc 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "lint:fix": "yarn run lint:fix:ts && yarn run lint:fix:prettier && yarn run lint:fix:eslint", "test:e2e": "lerna run cy:test", "test:e2e:ci": "lerna run cy:ci", - "build:docker": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh $BUDIBASE_RELEASE_VERSION && cd -", + "build:docker": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh $BUDIBASE_RELEASE_VERSION release && cd -", "build:docker:develop": "node scripts/pinVersions && lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh develop && cd -", "release:helm": "./scripts/release_helm_chart.sh", "multi:enable": "lerna run multi:enable",