From 4a86a280f0d78143328018aaf8aa7625003e46d7 Mon Sep 17 00:00:00 2001 From: Ben Lovell Date: Fri, 26 Jan 2024 12:09:42 +0000 Subject: [PATCH] Remove legacy build cruft --- Dockerfile | 9 --------- Jenkinsfile | 48 ---------------------------------------------- build.sh | 14 -------------- docker-compose.yml | 15 --------------- test.sh | 41 --------------------------------------- 5 files changed, 127 deletions(-) delete mode 100644 Dockerfile delete mode 100644 Jenkinsfile delete mode 100755 build.sh delete mode 100644 docker-compose.yml delete mode 100755 test.sh diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 9bd91c1..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM masdevtestregistry.azurecr.io/jenkins/ruby2.5.3:latest -MAINTAINER development.team@moneyadviceservice.org.uk - -RUN apt-get -qq update > /dev/null && \ - apt-get -qq dist-upgrade > /dev/null && \ - apt-get -qq clean > /dev/null && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -COPY . /var/tmp/app/ diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 0b86aca..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,48 +0,0 @@ -pipeline { - agent { label "master" } - environment { - COMPOSE_PROJECT_NAME = "${env.JOB_NAME}" - GITHUB_TOKEN = credentials('masbuild-github-token') - } - stages { - stage('prepare') { - steps { - script { - docker.withRegistry('https://masdevtestregistry.azurecr.io', 'acr_credentials') { - sh "docker-compose -f docker-compose.yml build --force-rm" - sh "docker-compose -f docker-compose.yml up -d" - } - } - } - } - stage ('branch-test') { - when { not { branch 'PR-*' } } - steps { - sh "docker-compose -f docker-compose.yml run --rm rails ./test.sh" - } - } - stage ('pr-test') { - when { branch 'PR-*' } - environment { - DANGER_CHANGE_ID = "${env.CHANGE_ID}" - DANGER_GIT_URL = "${env.GIT_URL}" - DANGER_JENKINS_URL = "${env.JENKINS_URL}" - } - steps { - sh "docker-compose -f docker-compose.yml run --rm rails ./test.sh" - } - } - stage('build') { - when { branch 'master' } - steps { - sh "docker-compose -f docker-compose.yml run --rm rails ./script/build" - } - } - } - post { - always { - sh 'docker-compose -f docker-compose.yml down --remove-orphans' - cleanWs() - } - } -} diff --git a/build.sh b/build.sh deleted file mode 100755 index 3f0f1d0..0000000 --- a/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -l - -set -e -x - -export RAILS_ENV=build -export BUNDLE_WITHOUT="development:test" - -CI_PIPELINE_COUNTER=${GO_PIPELINE_LABEL-0} -CI_EXECUTOR_NUMBER=${EXECUTOR_NUMBER-0} - -./bin/setup - -gem build mas-cms-client.gemspec - diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index f7c2bf3..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,15 +0,0 @@ -version: '2.1' -services: - rails: - build: - context: . - dockerfile: Dockerfile - environment: - - GITHUB_USER=$GITHUB_TOKEN_USR - - GITHUB_PASS=$GITHUB_TOKEN_PSW - - DANGER_GITHUB_API_TOKEN=$GITHUB_TOKEN_PSW - - CHANGE_ID=$DANGER_CHANGE_ID - - GIT_URL=$DANGER_GIT_URL - - JENKINS_URL=$DANGER_JENKINS_URL - - HTTP_REQUEST_TIMEOUT=10 - - LANG=C.UTF-8 diff --git a/test.sh b/test.sh deleted file mode 100755 index 1aed07d..0000000 --- a/test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -l - -if [ -f /.dockerenv ]; then - source ~/.bashrc - rvm use default - bundle config github.com $GITHUB_USER:$GITHUB_PASS -fi - -export RAILS_ENV=test -export BUNDLE_WITHOUT=development:build - -exit_code=0 - -function run { - declare -a tests_command=("$@") - echo '' - echo "=== Running \`${tests_command[*]}\`" - if ! ${tests_command[*]}; then - echo "=== These tests failed." - exit_code=1 - fi -} - -function info { - declare -a info_command=("$@") - echo '' - echo "=== Running for informational purposes \`${info_command[*]}\`" - if ! ${info_command[*]}; then - echo "== This test has errors and/or warnings. Please review results" - fi -} - -run ./bin/setup -run bundle exec rubocop . --fail-level error -run bundle exec rspec - -if [ -f /.dockerenv ]; then - run bundle exec danger --verbose -fi - -exit "$exit_code"