Skip to content

Commit

Permalink
amd64 ONLY, package updates (#475)
Browse files Browse the repository at this point in the history
* release token

* amd64 ONLY

* package updates
  • Loading branch information
carrolp authored Aug 22, 2024
1 parent 7779abb commit 93b682b
Show file tree
Hide file tree
Showing 3 changed files with 357 additions and 660 deletions.
216 changes: 58 additions & 158 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ services:

env:
global:
- GITHUB_TOKEN="${PUBLIC_GITHUB_TOKEN_2023_07_10}"
# The ipv4first option is needed to address node18 build issues on s390x
- NODE_OPTIONS="--dns-result-order=ipv4first"
- GITHUB_TOKEN="${PUBLIC_GITHUB_TOKEN_2024_08_20}"

before_install:
- echo "$DOCKERHUB_TOKEN" | docker login -u "icdevops" --password-stdin
Expand All @@ -21,158 +19,60 @@ before_install:
- export WS_WSS_URL=https://ibmets.whitesourcesoftware.com/agent
- ./build/download-kubelint.sh

jobs:
include:
- stage: building images
name: building amd64 image
arch: amd64
script:
# Audit npm packages. Fail build whan a PR audit fails, otherwise report the vulnerability and proceed.
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then npx audit-ci --config audit-ci.json; else npx audit-ci --config audit-ci.json || true; fi
- npm run lint
- npm test
- if [[ "${TRAVIS_TAG}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then npm version --no-git-tag-version "${TRAVIS_TAG}"; fi
- docker build --rm -t "quay.io/razee/watch-keeper:${TRAVIS_COMMIT}-amd64" .
- if [ -n "${TRAVIS_TAG}" ]; then docker tag quay.io/razee/watch-keeper:${TRAVIS_COMMIT}-amd64 quay.io/razee/watch-keeper:${TRAVIS_TAG}-amd64; fi
- docker images

before_deploy:
- docker login -u="${QUAY_ID}" -p="${QUAY_TOKEN}" quay.io

deploy:
# Deploy alpha builds
- provider: script
script: docker push "quay.io/razee/watch-keeper:${TRAVIS_TAG}-amd64"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+_[0-9]{3}$

# Deploy released builds
- provider: script
script: docker push "quay.io/razee/watch-keeper:${TRAVIS_TAG}-amd64"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$

- name: building ppc64le image
arch: ppc64le
script:
# Audit npm packages. Fail build whan a PR audit fails, otherwise report the vulnerability and proceed.
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then npx audit-ci --config audit-ci.json; else npx audit-ci --config audit-ci.json || true; fi
- npm test
- if [[ "${TRAVIS_TAG}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then npm version --no-git-tag-version "${TRAVIS_TAG}"; fi
- docker build --rm -t "quay.io/razee/watch-keeper:${TRAVIS_COMMIT}-ppc64le" .
- if [ -n "${TRAVIS_TAG}" ]; then docker tag quay.io/razee/watch-keeper:${TRAVIS_COMMIT}-ppc64le quay.io/razee/watch-keeper:${TRAVIS_TAG}-ppc64le; fi
- docker images

before_deploy:
- docker login -u="${QUAY_ID}" -p="${QUAY_TOKEN}" quay.io

deploy:
# Deploy alpha builds
- provider: script
script: docker push "quay.io/razee/watch-keeper:${TRAVIS_TAG}-ppc64le"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+_[0-9]{3}$

# Deploy released builds
- provider: script
script: docker push "quay.io/razee/watch-keeper:${TRAVIS_TAG}-ppc64le"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$

- name: building s390x image
arch: s390x
script:
# Audit npm packages. Fail build whan a PR audit fails, otherwise report the vulnerability and proceed.
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then npx audit-ci --config audit-ci.json; else npx audit-ci --config audit-ci.json || true; fi
- npm test
- if [[ "${TRAVIS_TAG}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then npm version --no-git-tag-version "${TRAVIS_TAG}"; fi
- docker build --rm -t "quay.io/razee/watch-keeper:${TRAVIS_COMMIT}-s390x" .
- if [ -n "${TRAVIS_TAG}" ]; then docker tag quay.io/razee/watch-keeper:${TRAVIS_COMMIT}-s390x quay.io/razee/watch-keeper:${TRAVIS_TAG}-s390x; fi
- docker images

before_deploy:
- docker login -u="${QUAY_ID}" -p="${QUAY_TOKEN}" quay.io

deploy:
# Deploy alpha builds
- provider: script
script: docker push "quay.io/razee/watch-keeper:${TRAVIS_TAG}-s390x"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+_[0-9]{3}$

# Deploy released builds
- provider: script
script: docker push "quay.io/razee/watch-keeper:${TRAVIS_TAG}-s390x"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$

- stage: publish multi-arch image, npm & github release
arch: amd64
script:
- if [[ $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then npm version --no-git-tag-version "${TRAVIS_TAG}"; fi
- ./build/process-template.sh kubernetes/watch-keeper/resource.yaml >/tmp/resource.yaml
- ./build/process-template.sh kubernetes/watch-keeper/rbac.yaml >/tmp/rbac.yaml
- kubelint /tmp/resource.yaml
- kubelint /tmp/rbac.yaml
- export DOCKER_CLI_EXPERIMENTAL=enabled
- sudo chown -R $USER:$USER /etc/docker/
- |
if [ -n "${TRAVIS_TAG}" ]; then
docker manifest create quay.io/razee/watch-keeper:${TRAVIS_TAG} \
quay.io/razee/watch-keeper:${TRAVIS_TAG}-amd64 \
quay.io/razee/watch-keeper:${TRAVIS_TAG}-ppc64le \
quay.io/razee/watch-keeper:${TRAVIS_TAG}-s390x
fi
# Perform UA scan on non-PR builds
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then curl -LJO https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar; java -jar wss-unified-agent.jar -d . || echo "UA Scan Error occurred"; fi

before_deploy:
- docker login -u="${QUAY_ID}" -p="${QUAY_TOKEN}" quay.io
# Use npm v9 for deployments (v10 has problems with authentication with api_key)
- npm install -g npm@9

deploy:
# Deploy alpha builds
- provider: script
script: docker manifest push "quay.io/razee/watch-keeper:${TRAVIS_TAG}"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+_[0-9]{3}$

# Deploy released builds
- provider: script
script: docker manifest push "quay.io/razee/watch-keeper:${TRAVIS_TAG}"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
- provider: releases
file:
- "/tmp/resource.yaml"
- "/tmp/rbac.yaml"
skip_cleanup: true
api_key: "${GITHUB_TOKEN}"
name: "${TRAVIS_TAG}"
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
- provider: npm
email: "${NPMJS_EMAIL}"
api_key: "${NPMJS_API_KEY}"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
script:
# Audit npm packages. Fail build whan a PR audit fails, otherwise report the vulnerability and proceed.
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then npx audit-ci --config audit-ci.json; else npx audit-ci --config audit-ci.json || true; fi
- npm run lint
- npm test
- if [[ "${TRAVIS_TAG}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]]; then npm version --no-git-tag-version "${TRAVIS_TAG}"; fi
- docker build --rm -t "quay.io/razee/watch-keeper:${TRAVIS_COMMIT}" .
- if [ -n "${TRAVIS_TAG}" ]; then docker tag quay.io/razee/watch-keeper:${TRAVIS_COMMIT} quay.io/razee/watch-keeper:${TRAVIS_TAG}; fi
- docker images
- ./build/process-template.sh kubernetes/watch-keeper/resource.yaml >/tmp/resource.yaml
- ./build/process-template.sh kubernetes/watch-keeper/rbac.yaml >/tmp/rbac.yaml
- kubelint /tmp/resource.yaml
- kubelint /tmp/rbac.yaml
# Perform UA scan on non-PR builds
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then curl -LJO https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar; java -jar wss-unified-agent.jar -d . || echo "UA Scan Error occurred"; fi

before_deploy:
- docker login -u="${QUAY_ID}" -p="${QUAY_TOKEN}" quay.io
# Use npm v9 for deployments (v10 has problems with authentication with api_key)
- npm install -g npm@9

deploy:
# Publish npm package with tag "next" on release candidates
- provider: npm
email: "${NPMJS_EMAIL}"
api_key: "${NPMJS_API_KEY}"
tag: next
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)$
# Publish docker image on release and release candidates
- provider: script
script: docker push "quay.io/razee/watch-keeper:${TRAVIS_TAG}"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$
# Publish npm package as "latest" on release
- provider: npm
email: "${NPMJS_EMAIL}"
api_key: "${NPMJS_API_KEY}"
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
# Publish GitHub release assets on release
- provider: releases
file:
- "/tmp/resource.yaml"
- "/tmp/rbac.yaml"
skip_cleanup: true
api_key: "${GITHUB_TOKEN}"
name: "${TRAVIS_TAG}"
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+$
Loading

0 comments on commit 93b682b

Please sign in to comment.