diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 3b14401..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,169 +0,0 @@ -name: Release - -on: - workflow_dispatch: - inputs: - version: - description: 'Release version' - required: true - -env: - GODIRS_NOVENDOR: '`go list ./... | grep -v /vendor/`' - PACKAGE_COMMONS: 'github.com/reportportal/commons-go' - RELEASE_DIR: 'release' - LINUX_ARTIFACT_NAME: 'service-index_linux_amd64' - WINDOWS_ARTIFACT_NAME: 'service-index_win_amd64.exe' - VERSION_PLACEHOLDER: '{{.version}}' - DOCKER_TEMPLATE_FILE: 'DockerfileTmpl' - DOCKER_BUILD_FILE: 'Dockerfile' - BUILD_INFO_LDFLAGS: >- - -ldflags "-extldflags '"-static"' - -X ${PACKAGE_COMMONS}/commons.repo=${GITHUB_REPOSITORY} - -X ${PACKAGE_COMMONS}/commons.branch=${GITHUB_SHA} - -X ${PACKAGE_COMMONS}/commons.buildDate=${BUILD_DATE} - -X ${PACKAGE_COMMONS}/commons.version=${VERSION}" - -jobs: - prepare: - runs-on: ubuntu-latest - outputs: - RELEASE_URL: ${{ steps.releaseUrl.outputs.RELEASE_URL }} - - steps: - - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: '1.22.1' - - - name: Go Linter - uses: golangci/golangci-lint-action@v4 - with: - version: v1.56.0 - args: '--deadline 10m' - - - name: Go Tests - run: 'go test ${{ env.GODIRS_NOVENDOR }}' - - - name: Go Dependencies - run: 'go mod download' - - - name: Setup git credentials - uses: oleksiyrudenko/gha-git-credentials@v2.1.1 - with: - name: 'reportportal.io' - email: 'support@reportportal.io' - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Tag release - id: tagRelease - run: | - git tag -a v${{ github.event.inputs.version }} -m 'Release ${{ github.event.inputs.version }}' - git push --tags - - - name: Create Release - id: createRelease - uses: ncipollo/release-action@v1 - with: - tag: v${{ github.event.inputs.version }} - name: Release ${{ github.event.inputs.version }} - - - name: Export release URL - id: releaseUrl - run: 'echo "RELEASE_URL=${{ steps.createRelease.outputs.upload_url }}" >> $GITHUB_OUTPUT' - - build: - runs-on: ubuntu-latest - needs: 'prepare' - - strategy: - matrix: - os: [ 'windows', 'linux' ] - arch: [ 'amd64', 'arm64' ] - exclude: - - os: 'windows' - arch: 'arm64' - - steps: - - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: '1.22.1' - - - name: Get Date - run: 'echo "BUILD_DATE=`date +%FT%T%z`" >> $GITHUB_ENV' - - - name: Generate name - run: | - if [ "${{ matrix.os }}" = "windows" ]; then - ARTIFACT_NAME_POSTFIX=".exe" - fi - echo "ARTIFACT_NAME=service-index_${{ matrix.os }}_${{ matrix.arch }}${ARTIFACT_NAME_POSTFIX}" >> $GITHUB_ENV - - - name: Go Build - env: - CGO_ENABLED: 0 - GOOS: ${{ matrix.os }} - GOARCH: ${{ matrix.arch }} - VERSION: ${{ github.event.inputs.version }} - run: | - if [ "${{ matrix.os }}" = "windows" ]; then - export CGO_ENABLED=0 - fi - - go build ${{ env.BUILD_INFO_LDFLAGS }} -o ${{ env.RELEASE_DIR }}/${{ env.ARTIFACT_NAME }} ./ - file ${{ env.RELEASE_DIR }}/${{ env.ARTIFACT_NAME }} - - - name: Upload Binary Asset - id: upload-binary-asset - env: - GITHUB_TOKEN: ${{ github.token }} - run: | - RELEASE_URL=`echo '${{ needs.prepare.outputs.RELEASE_URL }}' | sed -E 's/\{[^}]*\}//'` - curl \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${GITHUB_TOKEN}"\ - -H "X-GitHub-Api-Version: 2022-11-28" \ - -H "Content-Type: application/octet-stream" \ - "${RELEASE_URL}?name=${{ env.ARTIFACT_NAME }}" \ - --data-binary "@${{ env.RELEASE_DIR }}/${{ env.ARTIFACT_NAME }}" - - finish: - runs-on: ubuntu-latest - needs: 'build' - - steps: - - uses: actions/checkout@v4 - - - name: Setup git credentials - uses: oleksiyrudenko/gha-git-credentials@v2.1.1 - with: - name: 'reportportal.io' - email: 'support@reportportal.io' - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Update Dockerfile - id: dockerfileUpdate - run: | - sed 's/${{ env.VERSION_PLACEHOLDER }}/${{ github.event.inputs.version }}/g' ${{ env.DOCKER_TEMPLATE_FILE }} > ${{ env.DOCKER_BUILD_FILE }} - git add ${{ env.DOCKER_BUILD_FILE }} - export CHANGED=`git status | grep ${{ env.DOCKER_BUILD_FILE }} | xargs` - [ -z "${CHANGED}" ] || git commit -m "Dockerfile update" - - - name: Bump version - uses: HardNorth/github-version-generate@v1 - with: - version: ${{ github.event.inputs.version }}-SNAPSHOT - next-version-increment-patch: true - - - name: Commit version - run: | - echo ${{ env.NEXT_VERSION }} > ${{ github.workspace }}/VERSION - git add ${{ github.workspace }}/VERSION - export CHANGED=`git status | grep VERSION | xargs` - [ -z "${CHANGED}" ] || git commit -m 'Bump new snapshot version' - git push diff --git a/.releaser.yml b/.releaser.yml deleted file mode 100644 index a413911..0000000 --- a/.releaser.yml +++ /dev/null @@ -1,7 +0,0 @@ -bintray: - user: avarabyeu - org: epam - repo: reportportal - pack: service-index -artifactsFolder: release -replace: DockerfileTmpl=Dockerfile diff --git a/Jenkinsfile.k8s.groovy b/Jenkinsfile.k8s.groovy deleted file mode 100644 index 78c2ab8..0000000 --- a/Jenkinsfile.k8s.groovy +++ /dev/null @@ -1,104 +0,0 @@ -#!groovy -@Library('commons') _ - -//String podTemplateConcat = "${serviceName}-${buildNumber}-${uuid}" -def label = "worker-${env.JOB_NAME}-${UUID.randomUUID().toString()}" -println("Worker name: ${label}") - -podTemplate( - label: "${label}", - containers: [ - containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:alpine'), - containerTemplate(name: 'docker', image: 'docker', command: 'cat', ttyEnabled: true), - //alpine image does not have make included - containerTemplate(name: 'golang', image: 'golang:1.12.7', ttyEnabled: true, command: 'cat'), - - containerTemplate(name: 'kubectl', image: 'lachlanevenson/k8s-kubectl:v1.8.8', command: 'cat', ttyEnabled: true), - containerTemplate(name: 'helm', image: 'lachlanevenson/k8s-helm:v3.1.1', command: 'cat', ttyEnabled: true), - containerTemplate(name: 'httpie', image: 'blacktop/httpie', command: 'cat', ttyEnabled: true) - ], - volumes: [ - hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock'), - secretVolume(mountPath: '/etc/.dockercreds', secretName: 'docker-creds'), - hostPathVolume(mountPath: '/go/pkg/mod', hostPath: '/tmp/jenkins/go') - ] -) { - - node("${label}") { - /** - * General ReportPortal Kubernetes Configuration and Helm Chart - */ - def k8sDir = "kubernetes" - def k8sChartDir = "$k8sDir/reportportal/v5" - - /** - * Jenkins utilities and environment Specific k8s configuration - */ - def ciDir = "reportportal-ci" - def appDir = "app" - def testsDir = "tests" - - parallel 'Checkout Infra': { - stage('Checkout Infra') { - sh 'mkdir -p ~/.ssh' - sh 'ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts' - sh 'ssh-keyscan -t rsa git.epam.com >> ~/.ssh/known_hosts' - dir('kubernetes') { - git branch: "master", url: 'https://github.com/reportportal/kubernetes.git' - - } - dir(ciDir) { - git credentialsId: 'epm-gitlab-key', branch: "master", url: 'git@git.epam.com:epmc-tst/reportportal-ci.git' - } - } - }, 'Checkout Service': { - stage('Checkout Service') { - dir('app') { - checkout scm - } - } - } - - dockerUtil.init() - helm.init() - util.scheduleRepoPoll() - - def majorVersion; - dir('app') { - majorVersion = util.execStdout('cat VERSION') - } - - def srvRepo = "quay.io/reportportal/service-index" - def srvVersion = "$majorVersion-BUILD-${env.BUILD_NUMBER}" - def tag = "$srvRepo:$srvVersion" - - sast('reportportal_services_sast', 'rp/carrier/config.yaml', 'service-index', false) - - dir('app') { - container('golang') { - stage('Build') { - sh "make get-build-deps" - sh "make build v=$srvVersion" - } - } - container('docker') { - stage('Build Image') { - sh "docker build -t $tag -f DockerfileDev ." - } - stage('Push Image') { - sh "docker push $tag" - } - } - } - - stage('Deploy to Dev') { - helm.deploy("./$k8sChartDir", ["serviceindex.repository": srvRepo, "serviceindex.tag": srvVersion], false) // with wait - } - - stage('DVT Test') { - helm.testDeployment("reportportal", "reportportal-index", "$srvVersion", 30, 10) - } - - dast('reportportal_dast', 'rp/carrier/config.yaml', 'rpportal_dev_dast', false) - } -} diff --git a/JenkinsfileRelease b/JenkinsfileRelease deleted file mode 100644 index a4828cf..0000000 --- a/JenkinsfileRelease +++ /dev/null @@ -1,28 +0,0 @@ -#!groovy - -node { - - load "$JENKINS_HOME/jobvars.env" - - dir('src/github.com/reportportal/service-index') { - withEnv(["GOPATH=${JENKINS_HOME}/workspace/${JOB_NAME}", "BINTRAY_TOKEN=${BINTRAY_TOKEN}", "GO111MODULE=on"]) { - env.PATH="${GOPATH}/bin:$PATH" - - stage('Checkout') { - checkout scm - sh 'git checkout master' - sh 'git pull' - } - - stage('Build') { - sh 'go version' - sh 'make release' - sh 'file release/service-index_linux_amd64' - } - - } - - - } -} - diff --git a/VERSION b/VERSION index c68d476..26f30f7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.11.0 +5.13.0