Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
7cb0ce05
Unverified
Commit
7cb0ce05
authored
1 year ago
by
Diego Sampaio
Browse files
Options
Downloads
Patches
Plain Diff
ci: Add step to notify external services about a new release after Docker image publish (#30436)
parent
ff8e9d9f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/ci.yml
+67
-35
67 additions, 35 deletions
.github/workflows/ci.yml
with
67 additions
and
35 deletions
.github/workflows/ci.yml
+
67
−
35
View file @
7cb0ce05
...
...
@@ -323,13 +323,16 @@ jobs:
echo finished
deploy
:
name
:
🚀 Publish build a
nd update our registry
name
:
🚀 Publish build a
ssets
runs-on
:
ubuntu-20.04
if
:
github.event_name == 'release' || github.ref == 'refs/heads/develop'
needs
:
[
tests-done
,
release-versions
]
steps
:
-
uses
:
actions/checkout@v3
-
uses
:
Bhacaz/checkout-files@v2
with
:
files
:
package.json
branch
:
${{ github.ref }}
-
name
:
Restore build
uses
:
actions/download-artifact@v3
...
...
@@ -343,32 +346,17 @@ jobs:
AWS_SECRET_ACCESS_KEY
:
${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION
:
'
us-east-1'
GPG_PASSWORD
:
${{ secrets.GPG_PASSWORD }}
REDHAT_REGISTRY_PID
:
${{ secrets.REDHAT_REGISTRY_PID }}
REDHAT_REGISTRY_KEY
:
${{ secrets.REDHAT_REGISTRY_KEY }}
UPDATE_TOKEN
:
${{ secrets.UPDATE_TOKEN }}
run
:
|
REPO_VERSION=$(node -p "require('./package.json').version")
if [[ '${{ github.event_name }}' = 'release' ]]; then
GIT_TAG="${GITHUB_REF#*tags/}"
GIT_BRANCH=""
ARTIFACT_NAME="${REPO_VERSION}"
RC_VERSION=$GIT_TAG
if [[ '${{ needs.release-versions.outputs.release }}' = 'release-candidate' ]]; then
SNAP_CHANNEL=candidate
RC_RELEASE=candidate
elif [[ '${{ needs.release-versions.outputs.release }}' = 'latest' ]]; then
SNAP_CHANNEL=stable
RC_RELEASE=stable
fi
else
GIT_TAG=""
GIT_BRANCH="${GITHUB_REF#*heads/}"
ARTIFACT_NAME="${REPO_VERSION}.$GITHUB_SHA"
RC_VERSION="${REPO_VERSION}"
SNAP_CHANNEL=edge
RC_RELEASE=develop
fi;
ROCKET_DEPLOY_DIR="/tmp/deploy"
FILENAME="$ROCKET_DEPLOY_DIR/rocket.chat-$ARTIFACT_NAME.tgz";
...
...
@@ -386,22 +374,6 @@ jobs:
aws s3 cp $ROCKET_DEPLOY_DIR/ s3://download.rocket.chat/build/ --recursive
curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \
https://releases.rocket.chat/update
# Makes build fail if the release isn't there
curl --fail https://releases.rocket.chat/$RC_VERSION/info
if [[ $GIT_TAG ]]; then
curl -X POST \
https://connect.redhat.com/api/v2/projects/$REDHAT_REGISTRY_PID/build \
-H "Authorization: Bearer $REDHAT_REGISTRY_KEY" \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{"tag":"'$GIT_TAG'"}'
fi
build-docker-preview
:
name
:
🚢 Build Docker Image (preview)
runs-on
:
ubuntu-20.04
...
...
@@ -632,6 +604,66 @@ jobs:
echo "::endgroup::"
notify-services
:
name
:
🚀 Notify external services
runs-on
:
ubuntu-20.04
needs
:
-
services-docker-image-publish
-
docker-image-publish
-
release-versions
steps
:
-
uses
:
Bhacaz/checkout-files@v2
with
:
files
:
package.json
branch
:
${{ github.ref }}
-
name
:
Releases service
env
:
UPDATE_TOKEN
:
${{ secrets.UPDATE_TOKEN }}
run
:
|
REPO_VERSION=$(node -p "require('./package.json').version")
if [[ '${{ github.event_name }}' = 'release' ]]; then
GIT_TAG="${GITHUB_REF#*tags/}"
GIT_BRANCH=""
ARTIFACT_NAME="${REPO_VERSION}"
RC_VERSION=$GIT_TAG
if [[ '${{ needs.release-versions.outputs.release }}' = 'release-candidate' ]]; then
RC_RELEASE=candidate
elif [[ '${{ needs.release-versions.outputs.release }}' = 'latest' ]]; then
RC_RELEASE=stable
fi
else
GIT_TAG=""
GIT_BRANCH="${GITHUB_REF#*heads/}"
ARTIFACT_NAME="${REPO_VERSION}.$GITHUB_SHA"
RC_VERSION="${REPO_VERSION}"
RC_RELEASE=develop
fi;
curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \
https://releases.rocket.chat/update
# Makes build fail if the release isn't there
curl --fail https://releases.rocket.chat/$RC_VERSION/info
-
name
:
RedHat Registry
if
:
github.event_name == 'release'
env
:
REDHAT_REGISTRY_PID
:
${{ secrets.REDHAT_REGISTRY_PID }}
REDHAT_REGISTRY_KEY
:
${{ secrets.REDHAT_REGISTRY_KEY }}
run
:
|
GIT_TAG="${GITHUB_REF#*tags/}"
curl -X POST \
https://connect.redhat.com/api/v2/projects/$REDHAT_REGISTRY_PID/build \
-H "Authorization: Bearer $REDHAT_REGISTRY_KEY" \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{"tag":"'$GIT_TAG'"}'
trigger-dependent-workflows
:
runs-on
:
ubuntu-latest
if
:
github.event_name == 'release'
...
...
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