mirror of
https://github.com/caprover/caprover
synced 2025-12-15 15:55:40 +00:00
updated build script
This commit is contained in:
13
.github/workflows/publish_release.yml
vendored
Normal file
13
.github/workflows/publish_release.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
name: Build and push the release image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
run: sudo ./dev-scripts/build_and_push_release.sh
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,6 +6,8 @@
|
||||
/built
|
||||
/dist-frontend
|
||||
|
||||
version
|
||||
|
||||
# JetBrains
|
||||
.idea
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ git clean -fdx .
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
node ./dev-scripts/validateBuildVersion.js
|
||||
node ./dev-scripts/validate-build-version-docker-hub.js
|
||||
# Get version from constant file
|
||||
# Get version from tag (CAPROVER_VERSION_FROM_TAG) env var
|
||||
# Make sure the two are the same
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
// # Run API request to DockerHub and make sure it's a new version
|
||||
|
||||
const requestOriginal = require('request')
|
||||
const fs = require('fs-extra')
|
||||
|
||||
function request(url) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
@@ -32,20 +33,18 @@ let version = ''
|
||||
|
||||
Promise.resolve()
|
||||
.then(function () {
|
||||
|
||||
version = require('./built/utils/CaptainConstants').configs.version
|
||||
publishedNameOnDockerHub = require('./built/utils/CaptainConstants').configs.publishedNameOnDockerHub;
|
||||
version = require('../built/utils/CaptainConstants').default.configs
|
||||
.version
|
||||
publishedNameOnDockerHub = require('../built/utils/CaptainConstants')
|
||||
.default.configs.publishedNameOnDockerHub
|
||||
|
||||
if (!version || !publishedNameOnDockerHub) {
|
||||
throw new Error('Version and publishedNameOnDockerHub must be present')
|
||||
throw new Error(
|
||||
'Version and publishedNameOnDockerHub must be present'
|
||||
)
|
||||
}
|
||||
|
||||
if (version !== process.env.CAPROVER_VERSION_FROM_TAG) {
|
||||
throw new Error(`Version and CAPROVER_VERSION_FROM_TAG must be the same: ${version} ${process.env.CAPROVER_VERSION_FROM_TAG}`)
|
||||
}
|
||||
|
||||
var URL =
|
||||
`https://hub.docker.com/v2/repositories/${publishedNameOnDockerHub}/tags`
|
||||
var URL = `https://hub.docker.com/v2/repositories/${publishedNameOnDockerHub}/tags`
|
||||
|
||||
return request(URL)
|
||||
})
|
||||
@@ -92,6 +91,7 @@ Promise.resolve()
|
||||
)
|
||||
}
|
||||
|
||||
fs.outputFileSync(`./version`, version)
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
|
||||
Reference in New Issue
Block a user