Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build_deploy.sh #3

Merged
merged 4 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 0 additions & 64 deletions .github/workflows/release.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
def secrets = [
[path: params.VAULT_PATH_SVC_ACCOUNT_EPHEMERAL, engineVersion: 1, secretValues: [
[envVar: 'OC_LOGIN_TOKEN_DEV', vaultKey: 'oc-login-token-dev'],
[envVar: 'OC_LOGIN_SERVER_DEV', vaultKey: 'oc-login-server-dev']]],
[path: params.VAULT_PATH_QUAY_PUSH, engineVersion: 1, secretValues: [
[envVar: 'QUAY_USER', vaultKey: 'user'],
[envVar: 'QUAY_TOKEN', vaultKey: 'token']]],
[path: params.VAULT_PATH_RHR_PULL, engineVersion: 1, secretValues: [
[envVar: 'RH_REGISTRY_USER', vaultKey: 'user'],
[envVar: 'RH_REGISTRY_TOKEN', vaultKey: 'token']]]
]

def configuration = [vaultUrl: params.VAULT_ADDRESS, vaultCredentialId: params.VAULT_CREDS_ID, engineVersion: 1]

pipeline {
agent { label 'rhel8' }
options {
timestamps()
}
environment {
// --------------------------------------------
// Options that must be configured by app owner
// --------------------------------------------
APP_NAME="kessel" // name of app-sre "application" folder this component lives in
COMPONENT_NAME="spicedb-operator" // name of app-sre "resourceTemplate" in deploy.yaml for this component
IMAGE="quay.io/cloudservices/kessel-spicedb-operator" // image location on quay
RUN_PLATSEC=true // optional step to run vulnerability checks
CICD_URL="https://raw.githubusercontent.com/RedHatInsights/cicd-tools/main"
}
stages {
stage('Build the PR commit image') {
steps {
withVault([configuration: configuration, vaultSecrets: secrets]) {
sh './build_deploy.sh'
}

sh 'mkdir -p artifacts'
}
}
}
post {
always{
withVault([configuration: configuration, vaultSecrets: secrets]) {
sh '''
curl -s $CICD_URL/bootstrap.sh > .cicd_bootstrap.sh
source ./.cicd_bootstrap.sh

source "${CICD_ROOT}/post_test_results.sh"
'''
}
}
}
}
4 changes: 2 additions & 2 deletions build_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -exv

IMAGE="quay.io/cloudservices/spicedb-operator"
IMAGE="quay.io/cloudservices/kessel-spicedb-operator"
IMAGE_TAG=$(git rev-parse --short=7 HEAD)
GIT_COMMIT=$(git rev-parse --short HEAD)

Expand All @@ -18,5 +18,5 @@ DOCKER_CONF="$PWD/.docker"
mkdir -p "$DOCKER_CONF"
docker --config="$DOCKER_CONF" login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
docker --config="$DOCKER_CONF" login -u="$RH_REGISTRY_USER" -p="$RH_REGISTRY_TOKEN" registry.redhat.io
docker --config="$DOCKER_CONF" build --build-arg GIT_COMMIT=$GIT_COMMIT --no-cache -t "${IMAGE}:${IMAGE_TAG}" .
docker --config="$DOCKER_CONF" build --build-arg GIT_COMMIT=$GIT_COMMIT --no-cache -t "${IMAGE}:${IMAGE_TAG}" . -f ./Dockerfile.openshift
docker --config="$DOCKER_CONF" push "${IMAGE}:${IMAGE_TAG}"
Loading