diff --git a/build.sh b/build.sh deleted file mode 100755 index 366dbb2..0000000 --- a/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -docker build --no-cache -t slack-notify-resource . -docker tag -f slack-notify-resource 192.168.59.103:5000/slack-notify-resource -docker push 192.168.59.103:5000/slack-notify-resource - diff --git a/ci/pipeline.yml b/ci/pipeline.yml deleted file mode 100644 index fdb790b..0000000 --- a/ci/pipeline.yml +++ /dev/null @@ -1,187 +0,0 @@ ---- -# -# ci/pipeline.yml -# -# Pipeline structure file for a Docker Image pipeline -# -# DO NOT MAKE CHANGES TO THIS FILE. Instead, modify -# ci/settings.yml and override what needs overridden. -# This uses spruce, so you have some options there. -# -# author: James Hunt -# Dennis Bell -# created: 2016-03-04 - -meta: - name: (( param "Please name your pipeline" )) - release: (( grab meta.name )) - target: (( param "Please identify the name of the target Concourse CI" )) - url: (( param "Please specify the full url of the target Concourse CI" )) - pipeline: (( grab meta.name )) - image: starkandwayne/concourse - - aws: - bucket: (( concat meta.name "-pipeline" )) - access_key: (( param "Please set your AWS Access Key ID" )) - secret_key: (( param "Please set your AWS Secret Key ID" )) - - github: - uri: (( concat "git@github.com:" meta.github.owner "/" meta.github.repo )) - owner: (( param "Please specify the name of the user / organization that owns the Github repository" )) - repo: (( param "Please specify the name of the Github repository" )) - branch: master - private_key: (( param "Please generate an SSH Deployment Key for this repo and specify it here" )) - access_token: (( param "Please generate a Personal Access Token and specify it here" )) - - dockerhub: - email: (( param "Please specify the email address for your Dockerhub account" )) - username: (( param "Please specify the username for your Dockerhub account" )) - password: (( param "Please specify the password for your Dockerhub account" )) - repository: (( param "Please specify the name of the image (repo/name) that you are building" )) - - slack: - webhook: (( param "Please specify your Slack Incoming Webhook Integration URL" )) - notification: '(( concat ":concourse-fail: <" meta.url "/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME| Failed to build " meta.name "! Click for details.>" ))' - channel: (( param "Please specify the channel (#name) or user (@user) to send messages to" )) - username: concourse - icon: http://cl.ly/image/3e1h0H3H2s0P/concourse-logo.png - -groups: - - name: (( grab meta.name )) - jobs: - - build - - promote - - minor - - major - -jobs: - - name: build - public: true - serial: true - plan: - - get: git - trigger: true - - put: edge - params: { build: git } - on_failure: - put: notify - params: - channel: (( grab meta.slack.channel )) - username: (( grab meta.slack.username )) - icon_url: (( grab meta.slack.icon )) - text: (( grab meta.slack.notification )) - - - name: minor - public: true - plan: - - { get: version, trigger: false, params: {bump: minor} } - - { put: version, params: {file: version/number} } - - - name: major - public: true - plan: - - { get: version, trigger: false, params: {bump: major} } - - { put: version, params: {file: version/number} } - - - name: promote - public: true - serial: true - plan: - - aggregate: - - { get: version } - - { get: edge, passed: [build], params: { save: true } } - - { get: git, passed: [build] } - - - task: release - config: - image_resource: - type: docker-image - source: - repository: (( grab meta.image )) - platform: linux - inputs: - - name: git - - name: version - outputs: - - name: gh - - name: pushme - run: - path: ./git/ci/scripts/release - args: [] - params: - REPO_ROOT: git - RELEASE_ROOT: gh - RELEASE_NAME: (( grab meta.release )) - REPO_OUT: pushme/git - VERSION_FROM: version/number - - - put: latest # as 'latest' - params: - load: edge - - - put: latest # as 'vX.Y.Z' - params: - tag: version/number - tag_prefix: v - load: edge - - - put: version - params: - bump: patch - - put: git - params: - rebase: true - repository: pushme/git - - put: github - params: - name: gh/name - tag: gh/tag - body: gh/notes.md - -resource_types: - - name: slack-notification - type: docker-image - source: - repository: cfcommunity/slack-notification-resource - -resources: - - name: git - type: git - source: - uri: (( grab meta.github.uri )) - branch: (( grab meta.github.branch )) - private_key: (( grab meta.github.private_key )) - - - name: edge - type: docker-image - source: - .: (( inject meta.dockerhub )) - tag: edge - - - name: latest - type: docker-image - source: - .: (( inject meta.dockerhub )) - tag: latest - - - name: version - type: semver - source : - driver: s3 - bucket: (( grab meta.aws.bucket )) - key: version - access_key_id: (( grab meta.aws.access_key )) - secret_access_key: (( grab meta.aws.secret_key )) - initial_version: (( grab meta.initial_version || "0.0.1" )) - - - name: notify - type: slack-notification - source: - url: (( grab meta.slack.webhook )) - - - name: github - type: github-release - source: - user: (( grab meta.github.owner )) - repository: (( grab meta.github.repo )) - access_token: (( grab meta.github.access_token )) diff --git a/ci/repipe b/ci/repipe deleted file mode 100755 index 6b98fee..0000000 --- a/ci/repipe +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -# -# ci/repipe -# -# Script for merging together pipeline configuration files -# (via Spruce!) and configuring Concourse. -# -# author: James Hunt -# Dennis Bell -# created: 2016-03-04 - -need_command() { - local cmd=${1:?need_command() - no command name given} - - if [[ ! -x "$(command -v $cmd)" ]]; then - echo >&2 "${cmd} is not installed." - if [[ "${cmd}" == "spruce" ]]; then - echo >&2 "Please download it from https://github.com/geofffranks/spruce/releases" - fi - exit 2 - fi -} - -cd $(dirname $BASH_SOURCE[0]) -echo "Working in $(pwd)" -need_command spruce - -# Allow for target-specific settings -settings_file="$(ls -1 settings.yml ${CONCOURSE_TARGET:+"settings-${CONCOURSE_TARGET}.yml"} 2>/dev/null | tail -n1)" -if [[ -z "$settings_file" ]] -then - echo >&2 "Missing local settings in ci/settings.yml${CONCOURSE_TARGET:+" or ci/settings-${CONCOURSE_TARGET}.yml"}!" - exit 1 -fi - -echo >&2 "Using settings found in ${settings_file}" - -set -e -trap "rm -f .deploy.yml" QUIT TERM EXIT INT -spruce merge pipeline.yml ${settings_file} > .deploy.yml -PIPELINE=$(spruce json .deploy.yml | jq -r '.meta.pipeline // ""') -if [[ -z ${PIPELINE} ]]; then - echo >&2 "Missing pipeline name in ci/settings.yml!" - exit 1 -fi - -TARGET_FROM_SETTINGS=$(spruce json .deploy.yml | jq -r '.meta.target // ""') -if [[ -z ${CONCOURSE_TARGET} ]]; then - TARGET=${TARGET_FROM_SETTINGS} -elif [[ "$CONCOURSE_TARGET" != "$TARGET_FROM_SETTINGS" ]] -then - echo >&2 "Target in {$settings_file} differs from target in \$CONCOURSE_TARGET" - echo >&2 " \$CONCOURSE_TARGET: $CONCOURSE_TARGET" - echo >&2 " Target in file: $TARGET_FROM_SETTINGS" - exit 1 -else - TARGET=${CONCOURSE_TARGET} -fi - -if [[ -z ${TARGET} ]]; then - echo >&2 "Missing Concourse Target in ci/settings.yml!" - exit 1 -fi - -fly_cmd="${FLY_CMD:-fly}" - -set +x -$fly_cmd --target ${TARGET} set-pipeline --pipeline ${PIPELINE} --config .deploy.yml -$fly_cmd --target ${TARGET} unpause-pipeline --pipeline ${PIPELINE} diff --git a/ci/scripts/release b/ci/scripts/release deleted file mode 100755 index 55f4b60..0000000 --- a/ci/scripts/release +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# ci/scripts/release -# -# Script for generating Github release / tag assets -# and managing release notes for a Docker Image pipeline -# -# author: James Hunt -# Dennis Bell -# created: 2016-03-04 - -set -eu - -if [[ ! -f ${REPO_ROOT}/ci/release_notes.md ]]; then - echo >&2 "ci/release_notes.md not found. Did you forget to write them?" - exit 1 -fi - -if [[ -z ${VERSION_FROM} ]]; then - echo >&2 "VERSION_FROM environment variable not set, or empty. Did you misconfigure Concourse?" - exit 2 -fi -if [[ ! -f ${VERSION_FROM} ]]; then - echo >&2 "Version file (${VERSION_FROM}) not found. Did you misconfigure Concourse?" - exit 2 -fi -VERSION=$(cat ${VERSION_FROM}) -if [[ -z ${VERSION} ]]; then - echo >&2 "Version file (${VERSION_FROM}) was empty. Did you misconfigure Concourse?" - exit 2 -fi - -echo "v${VERSION}" > ${RELEASE_ROOT}/tag -echo "${RELEASE_NAME} v${VERSION}" > ${RELEASE_ROOT}/name -mv ${REPO_ROOT}/ci/release_notes.md ${RELEASE_ROOT}/notes.md - -# GIT! -if [[ -z $(git config --global user.email) ]]; then - git config --global user.email "ci@starkandwayne.com" -fi -if [[ -z $(git config --global user.name) ]]; then - git config --global user.name "CI Bot" -fi - -(cd ${REPO_ROOT} - git merge --no-edit master - git add -A - git status - git commit -m "release v${VERSION}") - -# so that future steps in the pipeline can push our changes -cp -a ${REPO_ROOT} ${REPO_OUT} diff --git a/ci/settings.yml b/ci/settings.yml deleted file mode 100644 index 685313e..0000000 --- a/ci/settings.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -# settings for the slack-notification-resource pipeline -meta: - target: sw - url: https://ci.vsphere.starkandwayne.com - name: slack-notification-resource - - initial_version: 1.1.0 - - aws: - access_key: (( vault "secret/aws/cfcommunity:access" )) - secret_key: (( vault "secret/aws/cfcommunity:secret" )) - - dockerhub: - email: (( vault "secret/dockerhub:email" )) - username: (( vault "secret/dockerhub:username" )) - password: (( vault "secret/dockerhub:password" )) - repository: cfcommunity/slack-notification-resource - - github: - owner: cloudfoundry-community - repo: slack-notification-resource - private_key: (( vault "secret/pipelines/slack-notification-resource/github:private" )) - access_token: (( vault "secret/pipelines/slack-notification-resource/github:token" )) - - slack: - webhook: (( vault "secret/pipelines/slack-notification-resource/slack:webhook" )) - channel: '#botspam'