From 232f9a36e4808861f910620121fe2eb3368453d5 Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Feb 17 2022 08:12:56 +0000 Subject: Delete Jenkinsfile and Dockerfile They are moved to internal repo. JIRA: RHELCMP-7813 Signed-off-by: Haibo Lin --- diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 5a5c6a4..0000000 --- a/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -FROM fedora:32 -LABEL \ - name="CTS" \ - vendor="CTS developers" \ - license="MIT" \ - build-date="" -ARG cacert_url=undefined - -WORKDIR /src -RUN cd /etc/yum.repos.d/ \ - && dnf -v -y install 'dnf-command(config-manager)' \ - && dnf config-manager --add-repo http://download-node-02.eng.bos.redhat.com/rel-eng/RCMTOOLS/latest-RCMTOOLS-2-F-\$releasever/compose/Everything/\$basearch/os/ \ - && dnf -v --nogpg -y install httpd python3-mod_wsgi mod_auth_gssapi python3-rhmsg mod_ssl mod_ldap \ - systemd \ - python3-pip \ - python3-fedora \ - python3-funcsigs \ - python3-openidc-client \ - python3-productmd \ - python3-flask-sqlalchemy \ - python3-flask-migrate \ - python3-mock \ - python3-systemd \ - python3-six \ - python3-flask \ - python3-defusedxml \ - python3-httplib2 \ - python3-pyOpenSSL \ - python3-sqlalchemy \ - python3-psycopg2 \ - python3-psutil \ - python3-ldap \ - python3-flask-login \ - python3-prometheus_client \ - && dnf -v -y install net-tools iproute iputils traceroute \ - && dnf -y clean all \ - && rm -f /tmp/* - -RUN if [ "$cacert_url" != "undefined" ]; then \ - cd /etc/pki/ca-trust/source/anchors \ - && curl -O --insecure $cacert_url \ - && update-ca-trust extract; \ - fi - -RUN chmod 755 /var/log/httpd - -COPY . . - -RUN mkdir -p /usr/share/cts && cp contrib/cts.wsgi /usr/share/cts/ - -RUN pip3 install . --no-deps - -WORKDIR /tmp -USER 1001 -EXPOSE 8080 - -ENTRYPOINT httpd -DFOREGROUND diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 29bc3b7..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,142 +0,0 @@ -/* - * SPDX-License-Identifier: GPL-2.0+ - */ -import groovy.json.* - -// 'global' var to store git info -def scmVars - -// CTS RPM dependencies -def installDepsCmd = ''' -sudo dnf -y install \ - python3-dogpile-cache \ - python3-fedmsg \ - python3-flask \ - python3-prometheus_client \ - python3-PyYAML \ - python3-requests -'''.trim() - -try { // massive try{} catch{} around the entire build for failure notifications - -node('master'){ - scmVars = checkout scm - scmVars.GIT_BRANCH_NAME = scmVars.GIT_BRANCH.split('/')[-1] // origin/pr/1234 -> 1234 - - // setting build display name - def branch = scmVars.GIT_BRANCH_NAME - if ( branch == 'master' ) { - echo 'Building master' - } -} - -timestamps { -node('docker') { - checkout scm - stage('Build Docker container') { - def appversion = sh(returnStdout: true, script: './get-version.sh').trim() - // Inject appversion so that we can know which version of image is used via about page - sh """sed -i -e "s/version=.*/version='$appversion',/" setup.py""" - - /* Git builds will have a version like 0.3.2.dev1+git.3abbb08 following - * the rules in PEP440. But Docker does not let us have + in the tag - * name, so let's munge it here. */ - appversion = appversion.replace('+', '-') - docker.withRegistry( - 'https://docker-registry.upshift.redhat.com/', - 'compose-upshift-registry-token') { - /* Note that the docker.build step has some magic to guess the - * Dockerfile used, which will break if the build directory (here ".") - * is not the final argument in the string. */ - def image = docker.build "compose/cts:internal-${appversion}", "--build-arg cacert_url=https://password.corp.redhat.com/RH-IT-Root-CA.crt ." - /* Pushes to the internal registry can sometimes randomly fail - * with "unknown blob" due to a known issue with the registry - * storage configuration. So we retry up to 3 times. */ - retry(3) { - image.push('latest') - } - } - /* Build and push the same image with the same tag to quay.io, but without the cacert. */ -/* docker.withRegistry( - 'https://quay.io/', - 'quay-io-factory2-builder-sa-credentials') { - def image = docker.build "factory2/cts:${appversion}", "." - image.push() - }*/ - } -} -node('fedora-29') { - checkout scm - scmVars.GIT_AUTHOR_EMAIL = sh ( - script: 'git --no-pager show -s --format=\'%ae\'', - returnStdout: true - ).trim() - - sh """ - ${installDepsCmd} - sudo dnf -y install python3-flake8 python3-pylint python3-sphinx \ - python3-sphinxcontrib-httpdomain python3-pytest-cov - """ - stage('Build Docs') { - sh ''' - sudo dnf install -y \ - python3-sphinx \ - python3-sphinxcontrib-httpdomain \ - python3-sphinxcontrib-issuetracker \ - gcc \ - krb5-devel \ - openldap-devel \ - python3-sphinxcontrib-httpdomain python3-pytest-cov \ - python3-flake8 python3-pylint python3-sphinx \ - python3-flask \ - python3-prometheus_client \ - python3-PyYAML \ - python3-requests \ - python3-flask-login \ - python3-flask-sqlalchemy \ - python3-ldap \ - python3-kobo \ - python3-kobo-rpmlib \ - python3-defusedxml \ - python3-tox \ - python3-productmd \ - python3-prometheus_client - ''' - sh 'CTS_DEVELOPER_ENV=1 make -C docs html' - archiveArtifacts artifacts: 'docs/_build/html/**' - } - if (scmVars.GIT_BRANCH == 'origin/master') { - stage('Publish Docs') { - sshagent (credentials: ['pagure-cts-deploy-key']) { - sh ''' - mkdir -p ~/.ssh/ - touch ~/.ssh/known_hosts - ssh-keygen -R pagure.io - echo 'pagure.io,140.211.169.204 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC198DWs0SQ3DX0ptu+8Wq6wnZMrXUCufN+wdSCtlyhHUeQ3q5B4Hgto1n2FMj752vToCfNTn9mWO7l2rNTrKeBsELpubl2jECHu4LqxkRVihu5UEzejfjiWNDN2jdXbYFY27GW9zymD7Gq3u+T/Mkp4lIcQKRoJaLobBmcVxrLPEEJMKI4AJY31jgxMTnxi7KcR+U5udQrZ3dzCn2BqUdiN5dMgckr4yNPjhl3emJeVJ/uhAJrEsgjzqxAb60smMO5/1By+yF85Wih4TnFtF4LwYYuxgqiNv72Xy4D/MGxCqkO/nH5eRNfcJ+AJFE7727F7Tnbo4xmAjilvRria/+l' >>~/.ssh/known_hosts - rm -rf docs-on-pagure - git clone ssh://git@pagure.io/docs/cts.git docs-on-pagure - rm -r docs-on-pagure/* - cp -r docs/_build/html/* docs-on-pagure/ - cd docs-on-pagure - git add -A . - if [[ "$(git diff --cached --numstat | wc -l)" -eq 0 ]] ; then - exit 0 # No changes, nothing to commit - fi - git config user.name "Jenkins Job" - git config user.email "nobody@redhat.com" - git commit -m 'Automatic commit of docs built by Jenkins job ${env.JOB_NAME} #${env.BUILD_NUMBER}' - git push origin master - ''' - } - } - } -} - -} // end of timestamps -} catch (e) { - // since the result isn't set until after the pipeline script runs, we must set it here if it fails - currentBuild.result = 'FAILURE' - throw e -} finally { - -}