Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Adds travis suffix and removes workflows handled on GA
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhutisawant committed Jun 23, 2021
1 parent d41b0da commit 8c46ce0
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 258 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build-publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,22 @@ jobs:
run: printf "//registry.npmjs.org/:_authToken=${{ secrets.CHE_NPM_AUTH_TOKEN }}\n" >> ~/.npmrc
- name: Publish packages to npmjs
run: yarn publish:next

travis-build:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Trigger build on Travis CI
run: |
body="{
\"request\":{
\"branch\":\"main\"
}}"
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token ${{ secrets.TRAVIS_TOKEN }}" \
-d "$body" \
https://api.travis-ci.com/repo/eclipse-che%2Fche-theia/requests
26 changes: 26 additions & 0 deletions .github/workflows/check-theia-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,29 @@ jobs:
docker pull quay.io/eclipse/che-theia-dev:next
docker tag quay.io/eclipse/che-theia-dev:next eclipse/che-theia-dev:next
./build.sh --root-yarn-opts:--ignore-scripts --dockerfile:Dockerfile.alpine --build-args:THEIA_GITHUB_REPO=${{ github.event.inputs.theia_github_repo }} --branch:${{ github.event.inputs.theia_branch }}
travis-build:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Trigger build on Travis CI
run: |
body="{
\"request\":{
\"config\": {
\"env\": {
\"global\": [
\"THEIA_GITHUB_REPO=${{ github.event.inputs.theia_github_repo }}\",
\"THEIA_BRANCH=${{ github.event.inputs.theia_branch }}\"
]
}
}
}}"
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token ${{ secrets.TRAVIS_TOKEN }}" \
-d "$body" \
https://api.travis-ci.com/repo/eclipse-che%2Fche-theia/requests
24 changes: 24 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,27 @@ jobs:
docker pull quay.io/eclipse/che-theia-dev:next
docker tag quay.io/eclipse/che-theia-dev:next eclipse/che-theia-dev:next
./build.sh --root-yarn-opts:--ignore-scripts --dockerfile:Dockerfile.${{matrix.dist}}
travis-build:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Trigger build on Travis CI
run: |
body="{
\"request\":{
\"config\": {
\"env\": {
\"global\": [
\"PR_NUMBER=${{ github.event.pull_request.number }}\"
]
}
}
}}"
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token ${{ secrets.TRAVIS_TOKEN }}" \
-d "$body" \
https://api.travis-ci.com/repo/eclipse-che%2Fche-theia/requests
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,29 @@ jobs:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
MATTERMOST_CHANNEL: eclipse-che-releases
MATTERMOST_USERNAME: che-bot

travis-release:
needs: build
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Trigger build on Travis CI
run: |
body="{
\"request\":{
\"config\": {
\"env\": {
\"global\": [
\"TAG=${{ github.event.inputs.version }}\"
]
}
}
}}"
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token ${{ secrets.TRAVIS_TOKEN }}" \
-d "$body" \
https://api.travis-ci.com/repo/eclipse-che%2Fche-theia/requests
138 changes: 28 additions & 110 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ install:
env:
global:
- TAG=next
- CDN_PREFIX=https://static.developers.redhat.com/che/theia_artifacts/
- MONACO_CDN_PREFIX=https://cdn.jsdelivr.net/npm/
- RECREATE_TAGS=false
- PUSH_TO_NPMJS=true
- TRAVIS_TAG=travis
- PR_NUMBER=

before_script:
- |
Expand All @@ -33,24 +31,24 @@ before_script:
fi
jobs:
fast_finish: true
allow_failures:
- if: env(PR_NUMBER) IS present
arch: arm64
- if: env(PR_NUMBER) IS present
arch: ppc64le
- if: env(PR_NUMBER) IS present
arch: s390x
include:
- stage: PR Check
if: type = pull_request
# check EOF newline
name: Linelint (eof-newline)
arch: amd64
install: skip
script:
- docker run -it -v $(pwd):/data fernandrone/linelint:0.0.5
- &node-build
stage: PR Check
name: Node Build on amd64
if: type = pull_request
if: env(PR_NUMBER) IS present
arch: amd64
install: skip
install:
- git fetch origin +refs/pull/${PR_NUMBER}/merge
- git checkout -qf FETCH_HEAD
script: yarn
#Test Coverage Report
after_success:
- if [[ "${TRAVIS_CPU_ARCH}" = "amd64" ]] ; then bash <(curl -s https://codecov.io/bash); fi
- <<: *node-build
name: Node Build on arm64
arch: arm64
Expand All @@ -61,11 +59,13 @@ jobs:
name: Node Build on s390x
arch: s390x
- &docker-build
if: type = pull_request
if: env(PR_NUMBER) IS present
name: Docker build (Alpine) on amd64
arch: amd64
env: DIST=alpine
install: skip
install:
- git fetch origin +refs/pull/${PR_NUMBER}/merge
- git checkout -qf FETCH_HEAD
script:
- |
set -e
Expand Down Expand Up @@ -99,40 +99,16 @@ jobs:
arch: s390x
env: DIST=ubi8

#happy-path
- &happy-path
name: happy-path (alpine, next)
if: type = pull_request
install: skip
env: DIST=alpine CHECTL_CHANNEL=next MINIKUBE_VERSION=v1.20.0
arch: amd64
script: ./.travis/happy-path-tests.sh
- <<: *happy-path
name: happy-path (alpine, stable)
env: DIST=alpine CHECTL_CHANNEL=stable MINIKUBE_VERSION=v1.20.0
- <<: *happy-path
name: happy-path (ubi8, next)
env: DIST=ubi8 CHECTL_CHANNEL=next MINIKUBE_VERSION=v1.20.0
- <<: *happy-path
name: happy-path (ubi8, stable)
env: DIST=ubi8 CHECTL_CHANNEL=stable MINIKUBE_VERSION=v1.20.0

- &build-and-push-next
stage: Build & Publish 'next'
name: Build & Publish image on amd64
if: type = push AND branch = master
if: type = api AND branch = main AND env(TAG) = "next"
arch: amd64
script:
- |
set -e
docker image prune -a -f
./build.sh --arch:${TRAVIS_CPU_ARCH} --root-yarn-opts:--ignore-scripts --dockerfile:Dockerfile.alpine --push
if [[ "${TRAVIS_CPU_ARCH}" = "amd64" ]] ; then
#Set-up npmjs auth token
printf "//registry.npmjs.org/:_authToken=${CHE_NPM_AUTH_TOKEN}\n" >> ~/.npmrc;
#Publish packages to npmjs
yarn publish:next
fi
./build.sh --arch:${TRAVIS_CPU_ARCH} --root-yarn-opts:--ignore-scripts --dockerfile:Dockerfile.alpine --push
- <<: *build-and-push-next
name: Build & Publish image on arm64
arch: arm64
Expand All @@ -144,23 +120,15 @@ jobs:
name: Build & Publish image on s390x

- stage: Publish multiarch image with 'next' tag
if: type = push AND branch = master
if: type = api AND branch = main AND env(TAG) = "next"
name: Publish multiarch image with next tag
script: .travis/publish_multiarch.sh

# publish-built-in-extension-report
- name: Publish Built In Extension Report
if: (type = push AND branch=master) OR (type = cron AND branch=master)
arch: amd64
script:
- export DATE_TIME=$(date +"%Y-%m-%d")
- .ci/publish-report.sh

- &check-a-theia-branch
stage: Check a Theia branch
name: Build an image against Theia branch on amd64
arch: amd64
if: env(THEIA_GITHUB_REPO) AND env(THEIA_BRANCH)
if: type = api AND env(THEIA_GITHUB_REPO) AND env(THEIA_BRANCH)
script:
- |
set -e
Expand All @@ -179,41 +147,7 @@ jobs:
name: Build an image against Theia branch on s390x

#Release Workflow
- stage: Check existing tags
if: type = api AND env(TAG) IS present AND env(TAG) != "next"
arch: amd64
script:
- |
set +e
git remote remove origin
git remote add origin https://${CHE_BOT_GITHUB_TOKEN}@github.com/eclipse-che/che-theia.git
VERSION=${TAG}
EXISTING_TAG=$(git ls-remote --exit-code origin refs/tags/${VERSION})
if [[ -n ${EXISTING_TAG} ]]; then
if [[ ${RECREATE_TAGS} == "true" ]]; then
echo "[INFO] Removing tag for ${VERSION} version. New tag will be recreated during release."
git push origin :$VERSION
else
echo "[ERROR] Cannot proceed with release - tag ${EXISTING_TAG} already exists."
exit 1
fi
else
echo "[INFO] No existing tags detected for $VERSION"
fi
- stage: Tag release
if: type = api AND env(TAG) IS present AND env(TAG) != "next"
arch: amd64
os: linux
script:
- |
git config --global user.name "Mykhailo Kuznietsov"
git config --global user.email "mkuznets@redhat.com"
export GITHUB_TOKEN=${CHE_BOT_GITHUB_TOKEN}
export AKAMAI_CHE_AUTH=${AKAMAI_CHE_AUTH}
git remote remove origin
git remote add origin https://${CHE_BOT_GITHUB_TOKEN}@github.com/eclipse-che/che-theia.git
./make-release.sh --version ${TAG}
- &prepare-release
- &release-che-theia
stage: Release che-theia
name: Build and publish image on amd64
if: type = api AND env(TAG) IS present AND env(TAG) != "next"
Expand All @@ -223,33 +157,17 @@ jobs:
BRANCH=${TAG%.*}.x
git checkout "${BRANCH}"
docker image prune -a -f
./build.sh --arch:${TRAVIS_CPU_ARCH} --root-yarn-opts:--ignore-scripts --dockerfile:Dockerfile.alpine --push
if [[ ${TRAVIS_CPU_ARCH} == "amd64" ]] && [[ ${PUSH_TO_NPMJS} == "true" ]]; then
#Set-up npmjs auth token
printf "//registry.npmjs.org/:_authToken=${CHE_NPM_AUTH_TOKEN}\n" >> ~/.npmrc
#Publish packages to npmjs
yarn publish:next
fi
- <<: *prepare-release
./build.sh --arch:${TRAVIS_CPU_ARCH} --root-yarn-opts:--ignore-scripts --dockerfile:Dockerfile.alpine --push
- <<: *release-che-theia
arch: arm64
name: Build and publish image on arm64
- <<: *prepare-release
- <<: *release-che-theia
arch: ppc64le
name: Build and publish image on ppc64le
- <<: *prepare-release
- <<: *release-che-theia
arch: s390x
name: Build and publish image on s390x

- stage: Publish multiarch image
if: type = api AND env(TAG) IS present AND env(TAG) != "next"
script: .travis/publish_multiarch.sh
after_success:
- |
set -e
echo "{\"username\":\"che-bot\",\"channel\":\"eclipse-che-releases\",\"text\":\":white_check_mark: Che Theia ${TAG} has been released: https://quay.io/eclipse/che-theia-dev:${TAG} https://quay.io/eclipse/che-theia:${TAG} https://quay.io/eclipse/che-theia-endpoint-runtime-binary:${TAG} https://quay.io/eclipse/che-theia-vsix-installer:${TAG}\"}" > mattermost.json
curl -i -X POST -H 'Content-Type: application/json' -d @mattermost.json $MATTERMOST_WEBHOOK_URL
after_failure:
- |
set -e
echo "{\"username\":\"che-bot\",\"channel\":\"eclipse-che-releases\",\"text\":\":no_entry_sign: Che Theia ${TAG} release has failed: https://github.com/eclipse-che/che-theia/actions/workflows/release.yml\"}" > mattermost.json
curl -i -X POST -H 'Content-Type: application/json' -d @mattermost.json $MATTERMOST_WEBHOOK_URL
Loading

0 comments on commit 8c46ce0

Please sign in to comment.