Commit 90f9fdfc authored by Olav Morken's avatar Olav Morken
Browse files

Upload module GitLab CI manifest to AWS S3

Upload a GitLab CI manifest for Puppet modules to an AWS S3
bucket. This will allow us to include a standard GitLab manifest in
all our Puppet modules, which will simplify using GitLab CI for Puppet
modules.
parent 72c7bd03
Pipeline #10055 failed
......@@ -2,7 +2,9 @@ image: registry.uninett.no/public/docker-builder:1.13.1-uninett9
stages:
- build
- manifest
- stable
- stable-manifest
build:
......@@ -15,12 +17,35 @@ build:
only:
- branches
manifest:
stage: manifest
image: debian:stretch
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends awscli
- sed -i "s%@CI_COMMIT_SHA@%${CI_COMMIT_SHA}%" module-gitlab-ci.yml
- aws --region eu-central-1 s3 cp module-gitlab-ci.yml "s3://uninett-puppet-deploy-script/gitlab-ci-${CI_COMMIT_REF_NAME}.yml" --acl public-read
- echo "GitLab CI manifest available at: https://uninett-puppet-deploy-script.s3.amazonaws.com/gitlab-ci-${CI_COMMIT_REF_NAME}.yml"
stable:
stage: stable
script:
- docker pull "registry.uninett.no/${CI_PROJECT_PATH}:${CI_COMMIT_SHA}"
- docker tag "registry.uninett.no/${CI_PROJECT_PATH}:${CI_COMMIT_SHA}" "registry.uninett.no/${CI_PROJECT_PATH}:latest"
- docker push "registry.uninett.no/${CI_PROJECT_PATH}:latest"
allow_failure: false
when: manual
only:
- master
stable-manifest:
stage: stable-manifest
image: debian:stretch
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends awscli
- sed -i "s%@CI_COMMIT_SHA@%${CI_COMMIT_SHA}%" module-gitlab-ci.yml
- aws --region eu-central-1 s3 cp module-gitlab-ci.yml "s3://uninett-puppet-deploy-script/gitlab-ci-latest.yml" --acl public-read
- echo "GitLab CI manifest available at: https://uninett-puppet-deploy-script.s3.amazonaws.com/gitlab-ci-latest.yml"
only:
- master
image: registry.uninett.no/puppet/deploy_scripts:@CI_COMMIT_SHA@
stages:
- build
- upload
before_script:
- /puppet-deploy-scripts/setup_ssh.sh
build:
stage: build
script:
- /puppet-deploy-scripts/config_build.sh
artifacts:
paths:
- modules
only:
- branches
upload:
stage: upload
script:
- /puppet-deploy-scripts/config_upload.sh
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment