Skip to content

Commit

Permalink
Merge pull request #4 from hashicorp/dev
Browse files Browse the repository at this point in the history
Merging from dev into main for 0.1.4 release
  • Loading branch information
Christian Frichot authored Nov 17, 2020
2 parents 825c81f + 0750f89 commit 2bd26b8
Show file tree
Hide file tree
Showing 6 changed files with 658 additions and 57 deletions.
106 changes: 83 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,44 @@ parameters:
default: "vault_selinux"
hc-version:
type: string
default: "0.1.3"
default: "0.1.4"
hc-package-iteration:
type: string
default: "1"

references:
docker-images:
fedora: &FEDORA_DOCKER_IMAGE "docker.mirror.hashicorp.services/fedora@sha256:ee55117b3058f2f12961184fae4b9c392586e400487626c6bd0d15b4eae94ecc"
# fedora: &FEDORA31_DOCKER_IMAGE "docker.mirror.hashicorp.services/fedora@sha256:ee55117b3058f2f12961184fae4b9c392586e400487626c6bd0d15b4eae94ecc"
fedora31: &FEDORA31_DOCKER_IMAGE "docker.mirror.hashicorp.services/fedora:31"
fedora32: &FEDORA32_DOCKER_IMAGE "docker.mirror.hashicorp.services/fedora:32"
fedora33: &FEDORA33_DOCKER_IMAGE "docker.mirror.hashicorp.services/fedora:33"
ubuntu: &UBUNTU_DOCKER_IMAGE "docker.mirror.hashicorp.services/circleci/buildpack-deps:bionic"
centos: &CENTOS_DOCKER_IMAGE "docker.mirror.hashicorp.services/centos:8"
centos8: &CENTOS8_DOCKER_IMAGE "docker.mirror.hashicorp.services/centos:8"
centos7: &CENTOS7_DOCKER_IMAGE "docker.mirror.hashicorp.services/centos:7"

environment: &ENVIRONMENT
HC_PRODUCT: << pipeline.parameters.hc-product >>
HC_VERSION: << pipeline.parameters.hc-version >>
HC_PACKAGE_ITERATION: << pipeline.parameters.hc-package-iteration >>
IMAGE_RPM_SYSTEM: *FEDORA_DOCKER_IMAGE
IMAGE_CENTOS_SYSTEM: *CENTOS_DOCKER_IMAGE
IMAGE_F31_SYSTEM: *FEDORA31_DOCKER_IMAGE
IMAGE_F32_SYSTEM: *FEDORA32_DOCKER_IMAGE
IMAGE_F33_SYSTEM: *FEDORA33_DOCKER_IMAGE
IMAGE_CENTOS8_SYSTEM: *CENTOS8_DOCKER_IMAGE
IMAGE_CENTOS7_SYSTEM: *CENTOS7_DOCKER_IMAGE
IMAGE_APT_SYSTEM: *UBUNTU_DOCKER_IMAGE

jobs:
persist-ci-script:
docker:
- image: *UBUNTU_DOCKER_IMAGE
environment:
<<: *ENVIRONMENT
steps:
- checkout
- persist_to_workspace:
root: .
paths:
- products/<< pipeline.parameters.hc-product >>/ci
package:
parameters:
host-image:
Expand All @@ -40,35 +58,53 @@ jobs:
# The below is required because I'm building on a generic CentOS and Fedora container
- when:
condition:
equal: [ << parameters.host-image >>, *FEDORA_DOCKER_IMAGE ]
equal: [ << parameters.host-image >>, *FEDORA31_DOCKER_IMAGE ]
steps:
- run: dnf -y install make
- when:
condition:
equal: [ << parameters.host-image >>, *FEDORA32_DOCKER_IMAGE ]
steps:
- run: dnf -y install make
- when:
condition:
equal: [ << parameters.host-image >>, *CENTOS_DOCKER_IMAGE ]
equal: [ << parameters.host-image >>, *FEDORA33_DOCKER_IMAGE ]
steps:
- run: dnf -y install make
- when:
condition:
equal: [ << parameters.host-image >>, *CENTOS8_DOCKER_IMAGE ]
steps:
- run: yum -y install make
- when:
condition:
equal: [ << parameters.host-image >>, *CENTOS7_DOCKER_IMAGE ]
steps:
- run: yum -y install make
- run:
name: Create linux packages
command: make package
- run:
name: Copy rpms to /tmp/circle-artifacts
command: mkdir -p /tmp/circle-artifacts && cp products/<< pipeline.parameters.hc-product >>/*.rpm /tmp/circle-artifacts
- store_artifacts:
path: /tmp/circle-artifacts
# - run:
# name: Copy rpms to /tmp/circle-artifacts
# command: mkdir -p /tmp/circle-artifacts && cp products/<< pipeline.parameters.hc-product >>/*.rpm /tmp/circle-artifacts
# - store_artifacts:
# path: /tmp/circle-artifacts
- persist_to_workspace:
root: .
paths:
- products/<< pipeline.parameters.hc-product >>/*.rpm
- when:
condition:
equal: [ << parameters.host-image >>, *CENTOS_DOCKER_IMAGE ]
steps:
- persist_to_workspace:
root: .
paths:
- products/<< pipeline.parameters.hc-product >>/ci
# - when:
# condition:
# equal: [ << parameters.host-image >>, *CENTOS8_DOCKER_IMAGE ]
# steps:
# - persist_to_workspace:
# root: .
# paths:
# - products/<< pipeline.parameters.hc-product >>/ci
validate-packages:
parameters:
target-image:
type: string
machine:
image: ubuntu-1604:201903-01
environment:
Expand All @@ -79,20 +115,44 @@ jobs:
- run:
name: Validate packages
command: |
./products/<< pipeline.parameters.hc-product >>/ci/validate.sh
TARGET_IMAGE=<< parameters.target-image >> ./products/<< pipeline.parameters.hc-product >>/ci/validate.sh
collect-packages:
docker:
- image: *UBUNTU_DOCKER_IMAGE
environment:
<<: *ENVIRONMENT
steps:
- attach_workspace:
at: .
- run:
name: Copy rpms to /tmp/circle-artifacts
command: mkdir -p /tmp/circle-artifacts && cp products/<< pipeline.parameters.hc-product >>/*.rpm /tmp/circle-artifacts
- store_artifacts:
path: /tmp/circle-artifacts

workflows:
version: 2
packaging:
jobs:
- persist-ci-script
- package:
name: package-<< matrix.host-image >>
matrix:
parameters:
host-image: [*FEDORA_DOCKER_IMAGE, *CENTOS_DOCKER_IMAGE]
host-image: [*FEDORA31_DOCKER_IMAGE, *FEDORA32_DOCKER_IMAGE, *FEDORA33_DOCKER_IMAGE, *CENTOS8_DOCKER_IMAGE, *CENTOS7_DOCKER_IMAGE]
# host-image: [*CENTOS_DOCKER_IMAGE]
requires:
- persist-ci-script
# filters:
# branches:
# only: dev
- validate-packages:
name: validate-package-<< matrix.target-image >>
matrix:
parameters:
target-image: [*FEDORA31_DOCKER_IMAGE, *FEDORA32_DOCKER_IMAGE, *FEDORA33_DOCKER_IMAGE, *CENTOS8_DOCKER_IMAGE, *CENTOS7_DOCKER_IMAGE]
requires:
- package-<< matrix.target-image >>
- collect-packages:
requires:
- package
- validate-packages
Loading

0 comments on commit 2bd26b8

Please sign in to comment.