Skip to content

Streamline CI #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://raw.githubusercontent.com/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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol this seems a bit excessive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, yeah. There is a replace directive in go mod. And while it works to force 3.3.10 => 3.3.22 in a single line, srcclr doesn't appear to respect that and still flags the original version 3.3.10 which has even higher severity warnings.

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.