Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
510a46db
Unverified
Commit
510a46db
authored
2 years ago
by
Ariya Hidayat
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove website update from the release script (#25647)
parent
eddda24f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/release/src/release.clj
+0
-2
0 additions, 2 deletions
bin/release/src/release.clj
bin/release/src/release/update_website.clj
+0
-103
0 additions, 103 deletions
bin/release/src/release/update_website.clj
with
0 additions
and
105 deletions
bin/release/src/release.clj
+
0
−
2
View file @
510a46db
...
...
@@ -13,7 +13,6 @@
[
heroku
:as
heroku
]
[
set-build-options
:as
set-build-options
]
[
uberjar
:as
uberjar
]
[
update-website
:as
update-website
]
[
version-info
:as
version-info
]]
[
release.common.slack
:as
slack
]))
...
...
@@ -29,7 +28,6 @@
:publish-draft-release
draft-release/create-draft-release!
:update-heroku-buildpack
heroku/update-heroku-buildpack!
:publish-elastic-beanstalk-artifacts
eb/publish-elastic-beanstalk-artifacts!
:update-docs
update-website/update-website!
:update-version-info
version-info/update-version-info!
))
(
defn-
do-steps!
[
steps
]
...
...
This diff is collapsed.
Click to expand it.
bin/release/src/release/update_website.clj
deleted
100644 → 0
+
0
−
103
View file @
eddda24f
(
ns
release.update-website
(
:require
[
clj-http.client
:as
http
]
[
clojure.string
:as
str
]
[
metabuild-common.core
:as
u
]
[
net.cgrand.tagsoup
:as
tagsoup
]
[
release.common
:as
c
]))
(
def
^
:private
website-git-repo
"metabase/metabase.github.io"
)
(
def
^
:private
website-branch
"master"
)
(
def
^
:private
dir
"/tmp/metabase.com"
)
(
defn-
update-website!*
[]
(
let
[
tag
(
str
\v
(
c/version
))]
(
u/delete-file!
dir
)
(
u/step
(
format
"Checkout website git repo %s to %s"
website-git-repo
dir
)
(
u/sh
"git"
"clone"
(
format
"git@github.com:%s.git"
website-git-repo
)
dir
)
(
u/sh
{
:dir
dir
}
"git"
"checkout"
website-branch
))
(
u/step
"Install npm dependencies"
(
u/sh
{
:dir
dir
}
"npm"
"ci"
))
(
u/step
"Fetch release branch docs"
(
u/sh
{
:dir
dir
}
"./script/docs"
tag
"--latest"
))
(
u/step
"Fetch master docs"
(
u/sh
{
:dir
dir
}
"./script/docs"
"master"
"--set-version"
"master"
))
(
u/step
"Commit updated docs"
(
u/sh
{
:dir
dir
}
"git"
"add"
"."
)
(
u/sh*
{
:dir
dir
}
"git"
"commit"
"-m"
tag
))
(
u/step
"delete old tags"
(
u/sh*
{
:dir
dir
}
"git"
"push"
"--delete"
"origin"
tag
)
(
u/sh*
{
:dir
dir
}
"git"
"tag"
"--delete"
"origin"
tag
))
(
u/step
"tag it"
(
u/sh
{
:dir
dir
}
"git"
"tag"
"-a"
tag
"-m"
tag
)
(
u/sh
{
:dir
dir
}
"git"
"push"
"--follow-tags"
"-u"
"origin"
website-branch
))))
(
defn-
parse-html-from-url
[
url
]
(
let
[{
:keys
[
status
^
String
body
]}
(
http/get
url
)]
(
assert
(
=
status
200
))
(
assert
(
string?
body
))
(
with-open
[
is
(
java.io.ByteArrayInputStream.
(
.getBytes
body
"UTF-8"
))]
(
second
(
tagsoup/parser
is
)))))
(
defn-
find-node
[
node
pred
]
(
if
(
pred
node
)
node
(
some
(
fn
[
child
]
(
find-node
child
pred
))
(
when
(
map?
node
)
(
:content
node
)))))
(
defn-
check-docs-version
[]
(
u/step
"Check docs version on website"
(
let
[
doc
(
parse-html-from-url
"https://www.metabase.com/docs/latest"
)
node
(
find-node
doc
#
(
and
(
map?
%
)
(
let
[{
:keys
[
tag
]
,
{
:keys
[
href
]}
:attrs
}
%
]
(
and
(
=
tag
:a
)
(
=
href
(
format
"/docs/v%s/"
(
c/version
)))))))]
(
when-not
node
(
throw
(
ex-info
(
format
"No link to /docs/v%s/ found"
(
c/version
))
{})))
(
u/announce
"Found link to /docs/v%s/"
(
c/version
))
(
u/step
"Make sure link text contains '(Latest)'"
(
let
[
content
(
find-node
node
(
fn
[
child
]
(
when
(
string?
child
)
(
str/includes?
child
"(Latest)"
))))]
(
assert
content
)
(
u/announce
"Found content %s"
(
pr-str
content
)))))))
(
defn-
check-jar-version
[]
(
u/step
"Check JAR version on website"
(
let
[
doc
(
parse-html-from-url
"https://metabase.com/start/oss/jar"
)
node
(
find-node
doc
#
(
and
(
map?
%
)
(
let
[{
:keys
[
tag
]
,
{
:keys
[
href
]}
:attrs
}
%
]
(
and
(
=
tag
:a
)
(
=
href
(
c/artifact-download-url
"metabase.jar"
))))))]
(
when-not
node
(
throw
(
ex-info
(
format
"No link to %s found"
(
c/artifact-download-url
"metabase.jar"
))
{}))))))
(
defn-
validate-website
[]
(
u/step
"Validate website updates"
(
u/announce
"NOTE: skipped for now, since it takes up to 10 minutes for changes to propagate."
)
;; TODO -- maybe just hard-reset the git repo to master and make sure the source files are in the correct place.
#
_
(
check-docs-version
)
#
_
(
check-jar-version
)))
(
defn
update-website!
[]
(
u/step
"Update Metabase.com with latest docs"
(
cond
(
c/pre-release-version?
)
(
u/announce
"Pre-release version -- not updating Metabase docs"
)
(
=
(
c/edition
)
:ee
)
(
u/announce
"EE build -- not updating Metabase docs"
)
(
not
(
c/latest-version?
))
(
u/announce
"Not the latest version -- not updating Metabase docs"
)
:else
(
do
(
update-website!*
)
(
validate-website
)))))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment