forked from GetSimpl/cloudlift
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INFRA-660] Dockerized cloudlift (GetSimpl#20)
* add Dockerfile to run tests in a consistent manner * fix service update test * update docker config * add Jenkinsfile * update Jenkinsfile * fix * improved jenkins file * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix working dirs * add git * add docker client * fix * review comments Co-authored-by: Bhavin Doshi <[email protected]>
- Loading branch information
1 parent
edfd5a3
commit 76cc7ce
Showing
5 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.git | ||
.gitignore | ||
venv | ||
*.egg-info | ||
dist | ||
Dockerfile | ||
build | ||
.pytest_cache | ||
**/__pycache__ | ||
**/*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.7.7-slim | ||
RUN apt-get update && apt-get install make git docker.io -y | ||
WORKDIR /cloudlift-bin | ||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
COPY . . | ||
RUN pip install -e . | ||
WORKDIR /workspace | ||
ENTRYPOINT ["cloudlift"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
pipeline { | ||
agent { | ||
label 'dockerbuild' | ||
} | ||
options { disableConcurrentBuilds() } | ||
stages { | ||
stage("Tag Cloudlift") { | ||
steps { | ||
println params | ||
sh ''' | ||
git remote set-url origin [email protected]:Rippling/cloudlift || git remote add origin [email protected]:Rippling/cloudlift | ||
if ! [ -z "${COMMIT_ID}" ]; then | ||
echo "Checking out custom commit id: ${COMMIT_ID}" | ||
git checkout ${COMMIT_ID} | ||
fi | ||
git fetch --prune origin "+refs/tags/*:refs/tags/*" | ||
echo "Tagging this commit: $(git rev-parse HEAD)" | ||
git tag ${TAG} | ||
git push origin refs/tags/${TAG} | ||
echo "List of git tag:\n$(git tag -l)" | ||
''' | ||
} | ||
} | ||
|
||
stage("Build Docker Image") { | ||
steps { | ||
sh ''' | ||
docker build -t cloudlift:${TAG} . | ||
''' | ||
} | ||
} | ||
|
||
stage('Push to ECR') { | ||
steps { | ||
sh ''' | ||
aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${AWS_RIPPLING_ACCOUNT} | ||
docker tag cloudlift:${TAG} ${AWS_RIPPLING_ACCOUNT}/cloudlift-repo:${TAG} | ||
docker push ${AWS_RIPPLING_ACCOUNT}/cloudlift-repo:${TAG} | ||
''' | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters