Skip to content
Snippets Groups Projects
Unverified Commit 0edb7eba authored by Dulmandakh's avatar Dulmandakh Committed by GitHub
Browse files

remove Circle CI, publish updates latest tag (#142)

parent 3c32945e
No related branches found
No related tags found
No related merge requests found
version: 2
defaults: &defaults
machine: true
working_directory: ~/project
aliases:
- &build-docker
name: Build Docker Image
command: |
docker build -t react-native-community/react-native .
docker run --rm --name rn-env react-native-community/react-native bin/sh -c "npx envinfo"
jobs:
deploy:
<<: *defaults
steps:
- checkout
- run: *build-docker
- run:
name: Deploy docker
command: |
source ~/.bashrc
nvm i node
node publish_docker.js
workflows:
version: 2
main:
jobs:
- deploy:
filters:
branches:
only: master
......@@ -24,17 +24,12 @@ jobs:
- name: Prepare tags
env:
DOCKER_IMAGE: reactnativecommunity/react-native-android
STABLE_MAJOR: 1
id: tags
run: |
VERSION=${GITHUB_REF#refs/tags/v}
MAJOR=$(echo $VERSION | cut -d'.' -f 1)
TAGS="$DOCKER_IMAGE:$VERSION,$DOCKER_IMAGE:$MAJOR"
if [[ $MAJOR == $STABLE_MAJOR ]]; then
TAGS="$TAGS,$DOCKER_IMAGE:latest"
fi
TAGS="$DOCKER_IMAGE:$VERSION,$DOCKER_IMAGE:$MAJOR,$DOCKER_IMAGE:latest"
echo ::set-output name=tags::${TAGS}
- name: Build & publish to Docker Hub
uses: docker/build-push-action@v2
with:
......
const execSync = require("child_process").execSync;
function publishDocker() {
const now = new Date()
const repo = `reactnativecommunity/react-native-android`
const cmd =`
docker login -u ${process.env.DOCKER_USER} -p ${process.env.DOCKER_PASS}
docker build -t ${repo} .
docker push ${repo}
`
cmd.trim().split("\n").map(i => {
const cmd = i.trim();
if (cmd) {
if (!cmd.includes('login')) {
console.log(cmd);
}
const output = execSync(cmd)
console.log(output.toString());
}
})
}
publishDocker()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment